From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B438C5B543 for ; Wed, 4 Jun 2025 22:35:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 808B76B00A0; Wed, 4 Jun 2025 18:35:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B93C6B02BC; Wed, 4 Jun 2025 18:35:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A8286B02BD; Wed, 4 Jun 2025 18:35:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 4B99D6B00A0 for ; Wed, 4 Jun 2025 18:35:46 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E15CBEE16B for ; Wed, 4 Jun 2025 22:35:45 +0000 (UTC) X-FDA: 83519176650.05.EBA62CA Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by imf06.hostedemail.com (Postfix) with ESMTP id E2A71180007 for ; Wed, 4 Jun 2025 22:35:43 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Q4zmKDqN; spf=pass (imf06.hostedemail.com: domain of khaledelnaggarlinux@gmail.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=khaledelnaggarlinux@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1749076544; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=XsxuIdbiBj+7yBzMpSX2Y7tbBVv3OjmpCi4ReJWvjY4=; b=8J0aEcJF7Ff29ILZQuntZBviK+X7aybdz3Wn9+6EHNAaCVa7bALZZ3fSiPWGCyfu1bDEzq gav7OVolvpF2dS4yH/icNJkJE6a+VGVDlUwh7eYYN0XyoEegZ2pSDJwNeX/cSgYFSfBDQ9 NNR0q2naw+i2yUONVM3tLfh3xmozDuc= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Q4zmKDqN; spf=pass (imf06.hostedemail.com: domain of khaledelnaggarlinux@gmail.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=khaledelnaggarlinux@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749076544; a=rsa-sha256; cv=none; b=zsbTWp42+wnoV2QholO78fMds9RwMsvjivPMgirLA/ckFQJ/08UYOA2Uqc635f3nVhyT0W lxmziyJUe0SyOOtLyA05rbCwIaYo+cuqhjcvZLh0xfMbgFDaoEhzWFnSwpRvCrQRGxnkCn NAB8Q1OuDo0hAtIDY86xPhWQeEeatXo= Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-3a3771c0f8cso185711f8f.3 for ; Wed, 04 Jun 2025 15:35:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749076542; x=1749681342; darn=kvack.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=XsxuIdbiBj+7yBzMpSX2Y7tbBVv3OjmpCi4ReJWvjY4=; b=Q4zmKDqNYEOnawn6UBBO+LMol5JLDah/yTfLNLt5ywhG2OMCxFrXeVxeOcXwHmzzfU OFSkelBJ3MomhTkqluLN4X0H2ewbz2PN8pG3qIEtxG+eF2SD+rneeAdmbbRKeWF20uaB Fd1ppIDVfvQ81iMch7jjUqINA4r9WkRzHvUdkuzNr4nlk3UxCQOuwo+fd6bBUQAjhyA8 epysXjqoME56m+rVP0cFKvNYEwLb4IdAPT+fFg02twtrnfzaRDgqYflm9om//bbtWBr2 TF48UxTy/CRCfAexAa423fw8gG0f3rCSgQsFyEH92lLuSDakkptrYpKQ6ljY6N/mQdVY U9UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749076542; x=1749681342; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XsxuIdbiBj+7yBzMpSX2Y7tbBVv3OjmpCi4ReJWvjY4=; b=k6rKTbu27/0bCea1C1A5/6PuwfOuxJ/ldduRdpeC8/cbFojJX4Hb+142B2k2y86q+l TKYlqCt5rSN3LseudO+5o8Oft6xW04XrcKkYExO4Xi/W6agsNmHMENLyn8W6cdh7MR4n ux5V+2tqF1tFy8o9NaDVnEIVrp1l26c9hJuz0dplu0nGbU6FVvc8KxXYwrLx1AQMGMXN d12sc2GHTR3FwlpyfCIABAYctcRkBP0G+f7B1KtO6EpDn27VjHzdk4x+FmdHdc76Vy74 vqj0Ifk5Bh0moWvbzoFEcjFcO5ba6Y0E51qeQsH9lP2vUibuL3YHj3qDjrobVLHa6D7L kGug== X-Gm-Message-State: AOJu0YwdAI82ZaZm/z3dPUGmi1UmF3T02gIhfOkkOi+tlxRTs65wYJEZ k2BGgsnRrI4t5BYHPrsUqpKtSRj3sVmpY941hhUKp3pGW42mYif4u0f3 X-Gm-Gg: ASbGncsPUPH5wC1UrIh6LE9xARwLkp4eUUYUPpEBTcY9KvzST0oLdCpgm+a+05Sd0WG 3Gp27eHJxMq47bwFOrXoFwUVX/brWvptjH7tKEwdVOy+WmGuxksoAEElep/vkkB235CkvTPWbR1 WzUXqpuCtdXidka2kCAbS3Bh7jT5QgAIpf61mZA2FSM/3uWmdXND/losE+AeUrcWPT+U39UIfY+ 3MNeu+iotuSg0RUMg7JtsO9hRhUGXI68H1lIIjvf4zAEM6JsUGMFokZNb9SqILvrQp+KzElXPu1 SafGGsvsTS2Ua6/TJckuuXCqZGALEsFhs1N89vj/cbG3ibX2K9il5GfPcNEqXdScFvQ= X-Google-Smtp-Source: AGHT+IGEcHI3RKpGrEdI8XRlMdKJaExfTVUZGwbopS+GoA+PBaW44CIH9k3dDaDSNYUTDJCDoEh9DA== X-Received: by 2002:a5d:584c:0:b0:3a4:fbaf:749e with SMTP id ffacd0b85a97d-3a51d985961mr3683521f8f.49.1749076542052; Wed, 04 Jun 2025 15:35:42 -0700 (PDT) Received: from [192.168.1.5] ([197.63.202.146]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4efe73f83sm22159582f8f.49.2025.06.04.15.35.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Jun 2025 15:35:40 -0700 (PDT) Message-ID: <959cfd37-1f27-4e2e-8922-19eb72227e28@gmail.com> Date: Thu, 5 Jun 2025 01:35:38 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RESEND] selftests/mm/run_vmtests.sh: skip hugevm tests if write_to_hugetlbfs is missing To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel-mentees@lists.linux.dev, shuah@kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <20250523184312.2647781-1-khaledelnaggarlinux@gmail.com> <20250602232233.224099-1-khaledelnaggarlinux@gmail.com> <20250602191216.7173b77e4f9ab5f659d1a448@linux-foundation.org> Content-Language: en-US From: Khaled Elnaggar In-Reply-To: <20250602191216.7173b77e4f9ab5f659d1a448@linux-foundation.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Stat-Signature: sqthxnisap53xj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V67IkGOZ 7yw6l/QiFW0nDjJ6HS5clOr7kGf4CnU1lsNnhWdgP6l708RMLErg9z+U+3LtiGeIomcz6hidmlzfP3WUT9gsuMigTupjuS4UxBTosXcGcOzDw3xw0dA8nh1yzPx5MJEVXU6XPGz8dOHLs8IYUfWgnMa+zdJvpuTqE2wN271EbWPn8TUqcglqXmPvM/PyS4I2aOshf1VvrNLCurmu6mvOPiJIwovFnj/z+AuoqC+7CPvtaV439YWABM0eAXEbJB5wWMU6T154C/Jrzv+WUzcuTkV630wQVjAbs47Yl9+VvF6MxHafJW5u8rS8GJu2gkEBaOfQR8nhksXqZpOLmiE5TBm9VEwoDOFuCBZ/sqTFhZHpD+Wl/tfTOmVdPotYd76e1Akmt4TGcSVH7Mym1tGIQL/czr+uafcsow0e3pTjJY55XQXWo8e2l6c4Qz6sP4PSDp4lwZ701sUp4++b4KYpMzx8stOMeLc5+t9xOzDC8YLoeepuk0FkwIPvXlA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 03/06/2025 5:12 am, Andrew Morton wrote: > On Tue, 3 Jun 2025 02:22:32 +0300 Khaled Elnaggar wrote: > >> The hugevm tests 'charge_reserved_hugetlb.sh' and 'hugetlb_reparenting_test.sh' >> depend on the 'write_to_hugetlbfs' binary to simulate writes to hugetlbfs >> while checking reservations asynchronously in the background. >> >> When this binary is missing (e.g., excluded from the build), these tests hang >> for up to 180 seconds. During this time, run_vmtests.sh is eventually killed >> due to timeout, aborting all subsequent tests. >> >> This patch skips these tests if the binary is not found, preventing delays >> and ensuring that the test suite runs to completion. > > OK, but why is write_to_hugetlbfs missing? If we're in a situation > where we _could_ run it then we _should_ run it! The user wants to > test stuff so we should test as much as we can. > So I'm thinking that it would be preferable to make sure the dang thing > is there? > Totally agree, let me try to explain how I understand the issue. The write_to_hugetlbfs binary is built from selftests/mm/Makefile, lines 136–142. It is only compiled if ARCH matches one of the explicitly listed 64-bit architectures: ``` ifneq (,$(filter $(ARCH),arm64 mips64 parisc64 powerpc riscv64 s390x sparc64 x86_64 s390)) TEST_GEN_FILES += va_high_addr_switch ifneq ($(ARCH),riscv64) TEST_GEN_FILES += virtual_address_range endif TEST_GEN_FILES += write_to_hugetlbfs endif ``` However, when the MM selftests are run from the kernel’s top-level Makefile, (root directory for example: make defconfig sudo make kselftest TARGETS=mm ARCH is resolved as x86, even on an x86_64 machine (Debian in my case), ARCH=x86 is the reason why the binary gets excluded from the build system. As far as I understand, the top-level Makefile normalizes both i.86 and x86_64 to x86 for ARCH variable: Makfile: lines: 383,403 383:include $(srctree)/scripts/subarch.include 403:ARCH ?= $(SUBARCH) scripts/subarch.include: line: 7 7:SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ This mapping probably makes sense for selecting the correct arch/ directory (since we have arch/x86, not arch/x86_64) for top-level Makefile. But the mm selftests Makefile expects ARCH to differentiate between x86 and x86_64 to decide whether to build certain binaries. As a result, the 64-bit-only binaries like write_to_hugetlbfs are skipped during build, yet still expected at runtime (by run_vmtests.sh). That's why this whole issue of the missing executable does not happen when ran from selftests/mm using something like: sudo make -C tools/testing/selftests/mm Because then selftests/mm/Makefile arch detection rus as intended. You're right — the proper fix is to improve how we propagate architecture information from the top-level Makefile to selftests. But since that's a larger change (and possibly beyond what I can safely attempt at this point), this patch is just a targeted workaround to avoid test stalls when the binary is missing. I hope I haven't gone completely wrong with this analysis, happy to improve or revise it further if needed.