From patchwork Wed Mar 6 22:37:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Pache X-Patchwork-Id: 13584694 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 A22F5C5475B for ; Wed, 6 Mar 2024 22:38:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 32CA86B00A1; Wed, 6 Mar 2024 17:38:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2E62E6B00A2; Wed, 6 Mar 2024 17:38:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1CB716B00A3; Wed, 6 Mar 2024 17:38:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 0DF656B00A1 for ; Wed, 6 Mar 2024 17:38:10 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id DA99DC063D for ; Wed, 6 Mar 2024 22:38:09 +0000 (UTC) X-FDA: 81868078698.03.70DFE41 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf01.hostedemail.com (Postfix) with ESMTP id 3955940005 for ; Wed, 6 Mar 2024 22:38:08 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DIUpxR3V; spf=pass (imf01.hostedemail.com: domain of npache@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=npache@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709764688; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=WhvHTa8E6KIfz47SC53e3jlZc8KPDvEvRYf6GRtCMqU=; b=l5sx5BQEqBsZsz/6QN3QC8yYkb37uBuuPWsSqVoZkyzMY79YI8Q/g+ZQMBpcSlEOwQOeKZ cfCnKSroi0d6cLyteex3I3YMrPHTk82WYGtbnUCbHBimu680H3WC/Bn2kZtTfZs7jx9KvK O6V7EYQA9LHyC+BXsFFPgz96FVrizWM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709764688; a=rsa-sha256; cv=none; b=m6fwaZuV2CegkcvgWQ2QpYFKeqBdYIf8u4n4DcWxoEUDYZRbnBCuEnS4EVTU9iudxy99IO jHGWJvPiDJf+9C9ukWuKdGtFcdZZtdRAbzz2nfZDjpUmJ4edIeLfnj2JFUoQ7Xgj0gwf24 M6gKZQVP4+ZIsHCKCfRqN8lUyZcirwU= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DIUpxR3V; spf=pass (imf01.hostedemail.com: domain of npache@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=npache@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709764687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WhvHTa8E6KIfz47SC53e3jlZc8KPDvEvRYf6GRtCMqU=; b=DIUpxR3VFiTfKNEbbarPUtDc0HfThXwcU7So/bFDJNIxQDCQilXTg9p/T86YqP2tfEi8VM tHS4JecbYe9bySOD50oY+lKsMlCJwMNu6bkW4ldC1qDsK8sLidYoEEUUws74dJAtEmx+Vn IHAjRp4Qun/64B9zaD8O086NdyRD7qc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-659-QO_v-DYrOPqLzMUdIsx2gA-1; Wed, 06 Mar 2024 17:38:03 -0500 X-MC-Unique: QO_v-DYrOPqLzMUdIsx2gA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A430E857A81; Wed, 6 Mar 2024 22:38:02 +0000 (UTC) Received: from localhost.redhat.com (unknown [10.22.9.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E907111D793; Wed, 6 Mar 2024 22:38:02 +0000 (UTC) From: Nico Pache To: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ben@decadent.org.uk, shuah@kernel.org, akpm@linux-foundation.org, usama.anjum@collabora.com Subject: [PATCH v2 1/3] selftests/mm: Dont fail testsuite due to a lack of hugepages Date: Wed, 6 Mar 2024 15:37:12 -0700 Message-ID: <20240306223714.320681-2-npache@redhat.com> In-Reply-To: <20240306223714.320681-1-npache@redhat.com> References: <20240306223714.320681-1-npache@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Stat-Signature: 5sg8u7nzdch676mjp6dqtzwq58q9dobd X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 3955940005 X-Rspam-User: X-HE-Tag: 1709764688-323048 X-HE-Meta: U2FsdGVkX1843KcVSeKWhGvxH6NHqpq+JfXeKfoprc1tNmpDov8puN3RZRvqHwtSa1sTlt5HVYr8YqTQeGbynnRRMaa8Kh/Vq9Fw446u1lj/WyZ4UhcryyuGTp8IhSE303oWBvQxBk/Vxl+ij89/fcuHyGlI8sgbk1SH+STNvLi/p1F57mSznWlYCa3tRiiOXCliY/chLy3vW99jN6a5+ygZZLbBZF6cOwANrDa+BrbGrY6fUWAOTPSfuedt4jd/LyEMWWXoL/wClSTNlJa+I9IFBSQ2Y0Iz1++f1zWsLGeovpfvG1TmIht5CMdZhe+Yc9xRpSKjVEs1fVKEex0QgfemXnbaS+EsH/bhZKLajJYuugCdRiKgl8PfhKCe08uSZjnRfFBVtUnQwuNKSPlvoQX7HpFrmeDxoC4jgLoiy98SpuKgsUBvJ8QvCVIKXKbw8QLIg3rWhwGXKqk1Nwx93f3299soZmP/6F48aVbauiGdXZ7KPUM6bIUMXDmLFN6307MQQY/t8PuBFkGwZFjeZ3nsh4+r5JIWZLbmIezMz2tcfk0rKNPzn00t9SYBaD2vqh6ptHAsFc18qg41DcTkWOJ7KHQCsOw+SO/xPzKpe94tc+ZYjI+KcZZBu8wZknH7LufgL/uqwTLXpnleQ+znC8CZEh9EWtim0Jd3hDTN41zYm0reM9uHm3gaefg4EYzqc78ha+8CqBEuS3/TLaCmCxhT8Hkb124CciNxJlhxIOMuU9u48E/sL+evqVNOHUz+cf/+5q5Dg+Zc0lbNwIJYC28NfeiZePGHT9JC0jbki9RDRqu6JkgoyBx7Y39VCpSODDX+2K55zol01JQzvsA1P6NUveV4QAGWzSqFTnLG9XXHKe4DrfPGg5uscKPSLluZK7wp1sS1MPyyzsW0ojw7COe0leQyPiJIXICb6XT8ARZ6soUNNx7tlC/lwjEcx9qB7uPPbYto4Ycc856nb3S 7EpvW8Mj 6fE566YPtst26KMTNc1TXW6xryZY++p8k1+BejruJB4DoiUbitYcY67SDWmk7iHql9pYl1YGMAAp9p9U9JuLuJxte/xXGkibqTcfLlugd9pzmE8/xUA8YEKx3mAlwbaBcq4Xd7vQ1vr0Y1DYR8rVLbz41l40axV0YZDWT5WDf+bj8BOY= 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 systems that have large core counts and large page sizes, but limited memory, the userfaultfd test hugepage requirement is too large. Exiting early due to missing one test's requirements is a rather aggressive strategy, and prevents a lot of other tests from running. Remove the early exit to prevent this. Fixes: ee00479d6702 ("selftests: vm: Try harder to allocate huge pages") Signed-off-by: Nico Pache --- tools/testing/selftests/mm/run_vmtests.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh index 246d53a5d7f28..727ea22ba408e 100755 --- a/tools/testing/selftests/mm/run_vmtests.sh +++ b/tools/testing/selftests/mm/run_vmtests.sh @@ -173,7 +173,6 @@ if [ -n "$freepgs" ] && [ -n "$hpgsize_KB" ]; then if [ "$freepgs" -lt "$needpgs" ]; then printf "Not enough huge pages available (%d < %d)\n" \ "$freepgs" "$needpgs" - exit 1 fi else echo "no hugetlbfs support in kernel?" From patchwork Wed Mar 6 22:37:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Pache X-Patchwork-Id: 13584695 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 DAB5FC54E49 for ; Wed, 6 Mar 2024 22:38:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D169F6B00A3; Wed, 6 Mar 2024 17:38:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CA2386B00A2; Wed, 6 Mar 2024 17:38:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B41846B00A5; Wed, 6 Mar 2024 17:38:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A73CA6B00A2 for ; Wed, 6 Mar 2024 17:38:10 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 61EDF805F5 for ; Wed, 6 Mar 2024 22:38:10 +0000 (UTC) X-FDA: 81868078740.04.118443A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf10.hostedemail.com (Postfix) with ESMTP id D74C2C0018 for ; Wed, 6 Mar 2024 22:38:07 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=K94+mZtF; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf10.hostedemail.com: domain of npache@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=npache@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709764687; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=zDmyGePUUlnnXiKRIxOi1EKt7GfptI6swe//338fxpI=; b=3NGHiAkLSj878GJZsOQrXdL1tmCX/b24pg0UWYz1novXZmbG98tK+rzcydaYpChdBGj6eb Zwgy//r9HXzzmxI1EZs5UHPZKVfJ74iXKTUkvfFS2fCVadDSGYri1moVxR8f7QC99Cjcmd tZSOqx/xh9VcWx8XGw6GrF3y+BUYiWM= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=K94+mZtF; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf10.hostedemail.com: domain of npache@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=npache@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709764687; a=rsa-sha256; cv=none; b=YmMTO9sKtbFy/+BtT7eBSvOOcG6YutvN1Ih+T2da/u7ufK2vIrvxM4XchpOMdXpWhCETOD UFOKxiwglsjUIIcGcIkoeJ4s4yHcMZg/H6nS7lv5djWkVIgg7oACIWXZgKxQMQpzhKrbOO j8XWzj29K83s6dDuVT9ZRVo7s86TbnM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709764687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zDmyGePUUlnnXiKRIxOi1EKt7GfptI6swe//338fxpI=; b=K94+mZtFuULgVsWKLuKMupYqcGPVB7Mcs4bB0K/pOTEBeis4NE2cnsGbwqRuy7FPbU1ACG dTSwc4x9+mz7VLvX+1xSR1bsw1/P7sTTwzIww81I4lR4IKtsoscTdFxb4UfFEDC/PNo56O wS82Q7JC1amsefI5eW0buYyL9+Iexck= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-495-T2GTcx7CNWKwblB0nSnOpw-1; Wed, 06 Mar 2024 17:38:03 -0500 X-MC-Unique: T2GTcx7CNWKwblB0nSnOpw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4CA50800269; Wed, 6 Mar 2024 22:38:03 +0000 (UTC) Received: from localhost.redhat.com (unknown [10.22.9.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB4D1111D789; Wed, 6 Mar 2024 22:38:02 +0000 (UTC) From: Nico Pache To: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ben@decadent.org.uk, shuah@kernel.org, akpm@linux-foundation.org, usama.anjum@collabora.com Subject: [PATCH v2 2/3] selftests/mm: Skip uffd hugetlb tests with insufficient hugepages Date: Wed, 6 Mar 2024 15:37:13 -0700 Message-ID: <20240306223714.320681-3-npache@redhat.com> In-Reply-To: <20240306223714.320681-1-npache@redhat.com> References: <20240306223714.320681-1-npache@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: D74C2C0018 X-Stat-Signature: ep5z5jzi773ybb7rephnryyduizi1i3o X-HE-Tag: 1709764687-754558 X-HE-Meta: U2FsdGVkX1+6td8pfRSjaSlD3sd7r99/CudtpOCLumwmCZssKQvNwbLXY2juj278WDAgJUe1mFO2pmCej3gI9nlXFqoVY6XcldtlMoSl5AVy1lWMgCa8e00rMP4bRc+7fMsOXd1Ung+z8cFjfqrtGUkFTUP3xhq8XBzPjtTP3TO7UpveqYFnbGj8GQk+JQP83bIqzxZFeZ/g6c6Gh81q7liPwETJcI7F7924PkEbWM6jWOONbrc30iF3bSIt1L4UiYr84PxnwxAZPSRSlZ6svYPUT9hY+weLP0jBUzD0hIM0fstXX6S26kaqpKu35CvniyXXTOs+AfuIM8luMRRXWYMb9ZwYIUvQjjty9rVE3AM0RFgLOQz68BE3O8G6/L4PWBgj0KXoaBcwXQC7Hv6xcuzgaCsR/2gOqJLk7GBEZCeARpqg4Q0qy8yhEUQrCTsKzyBtZcsvODa80pVCdt5ySkE/AcRUKGHPpJN+Tp5vjiLW9nEeFo3Wm+8A1051+Y4MQjQVbHsLQ/+ZEWXkY8u5O2wwWYijXfNValGfxtqPAXOMgt579ndFx2kHVH+6zUqreOkPsQUiH1U8aCsFHWy3sXtX/l+W6yaCpIBh1Kv5e0ncHPrAHi0R9ywvF5IDxLKaXOOQvhRDMgA0N2cs7S52PK4Ktsh5qVmZWSlC7S8YFEOYKUhnwdBguu/8XZNtU9+7bhmOkpKqK+hO7Szj1vCROpuyB17Y3sNjDFenS0rdZb7Ma4DiCI6MLVV4UynRnh4invurls0h1AOe5hpxJSbE0hTqQZUSir8LfGVAhF5s40qhuL/KHsqN2umgWQbtmj6hVSoILB72pePTweu+Ix3wjPoWgP9ekWOMMqAnXSK74v3CB7H3dLstHYE/v5jz/okLwWUJEN2TRRXKQJ3yk7slCA== 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: Now that run_vmtests.sh does not guarantee that the correct hugepage count is available, add a check inside the userfaultfd hugetlb test to verify the nr_hugepages count before continuing. Signed-off-by: Nico Pache --- tools/testing/selftests/mm/uffd-stress.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/mm/uffd-stress.c b/tools/testing/selftests/mm/uffd-stress.c index 7e83829bbb335..1165446f10883 100644 --- a/tools/testing/selftests/mm/uffd-stress.c +++ b/tools/testing/selftests/mm/uffd-stress.c @@ -441,6 +441,12 @@ int main(int argc, char **argv) parse_test_type_arg(argv[1]); bytes = atol(argv[2]) * 1024 * 1024; + if (test_type == TEST_HUGETLB && + get_free_hugepages() < bytes / page_size) { + printf("skip: Skipping userfaultfd... not enough hugepages\n"); + return KSFT_SKIP; + } + nr_cpus = sysconf(_SC_NPROCESSORS_ONLN); nr_pages_per_cpu = bytes / page_size / nr_cpus; From patchwork Wed Mar 6 22:37:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Pache X-Patchwork-Id: 13584696 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 C10AAC5475B for ; Wed, 6 Mar 2024 22:38:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0248F6B00A2; Wed, 6 Mar 2024 17:38:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DDBE56B00A6; Wed, 6 Mar 2024 17:38:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C048A6B00A4; Wed, 6 Mar 2024 17:38:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A83026B00A3 for ; Wed, 6 Mar 2024 17:38:10 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 5C40714049A for ; Wed, 6 Mar 2024 22:38:10 +0000 (UTC) X-FDA: 81868078740.03.ED3DF00 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf15.hostedemail.com (Postfix) with ESMTP id CB182A0011 for ; Wed, 6 Mar 2024 22:38:08 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DQzW9QvJ; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf15.hostedemail.com: domain of npache@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=npache@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709764688; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=y5UoDnaGLpcXO5m45dBk4QmmCIzBiCAc96cRj4x0Prw=; b=w53CStCKfjHKeJrIiR97RzAXWjMKzzKNEHnfaIUnY/u0999tAXHUo7qgY0Pa1TFvb0dvDi 75o7wevDizs8J1lZWx7fdrV3s7ChSLm/tvABjWRSbmngB8l96hz0yCg3OLPG4cedQkIDRz NuXrfPwyVN0SNrOrlr5A79yMe2ocqr0= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DQzW9QvJ; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf15.hostedemail.com: domain of npache@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=npache@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709764688; a=rsa-sha256; cv=none; b=HqLzLDBLVwDhz/82eJJOAwxZjoV4Mi0MVutcdD0aLWr3cuZCwGhg5WOcQboT99mXQpUEpZ TjRnDchRJx7IssZ2wEP9urFPebhso9rXpZUy3oWd7SkxFaKpTYWKql68ZDWdMDEyKBZzxi R5jCGliPbpKH02Emr8aaN/KQMYs+MU8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709764688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y5UoDnaGLpcXO5m45dBk4QmmCIzBiCAc96cRj4x0Prw=; b=DQzW9QvJo7WOhyvnr4V43VJDX3YcWjrQ57RyfqmPARfZbI9F6D1eh0xvCXSJeCHg5AcrB5 cN1BX5bHgbH/XIFFaTVrlHvy39Tm3F+JHojePb5nHYCWsU1YGKH5H+Ao0v2pTd0opmd9o8 trWhwj7Jvg+keDP0kT4ZlpG/KuQICl4= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-624-DskwdaCkNtWCQR4R0kgcgQ-1; Wed, 06 Mar 2024 17:38:04 -0500 X-MC-Unique: DskwdaCkNtWCQR4R0kgcgQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E91CD2804808; Wed, 6 Mar 2024 22:38:03 +0000 (UTC) Received: from localhost.redhat.com (unknown [10.22.9.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id 63AA5111D793; Wed, 6 Mar 2024 22:38:03 +0000 (UTC) From: Nico Pache To: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ben@decadent.org.uk, shuah@kernel.org, akpm@linux-foundation.org, usama.anjum@collabora.com Subject: [PATCH v2 3/3] selftests/mm: Skip the hugetlb-madvise tests on unmet hugepage requirements Date: Wed, 6 Mar 2024 15:37:14 -0700 Message-ID: <20240306223714.320681-4-npache@redhat.com> In-Reply-To: <20240306223714.320681-1-npache@redhat.com> References: <20240306223714.320681-1-npache@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Rspam-User: X-Stat-Signature: 1j6zb7hknhd4zzqhxoe7w6t1jraot15j X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: CB182A0011 X-HE-Tag: 1709764688-434154 X-HE-Meta: U2FsdGVkX186WaCAZBtYXyawCq3jKeuRIJPGK9Yb6x0iv136aIrmNLbjI0am3ANziUCL2KSpqmI0DLcn4K+Cg8C2+w5XiSlNrHKqcW2kdXeLVZfEFCSGRQ0P+lvviz/LCVHb8xVuxFpIWlQJQTfYWjxypy5jP0le7rGHXPvQsaWQdZ9/adeXAppo8Mu1VzZPKH+P2unsAKOYFCftGRrpQoL6WEfaqm9yK5uzRt6vyPqIc6J/5F3s4If6b+dWSnzuCLeZ9+POz0SFuFyY3VKMrlXbsCqGsu+Y6cL4oqpz0RS0Ipt2X0qDZfZDNJduHFfifw7Nw51ogUUKLIAqDzmToYXqhazJ/FTUZQ2jC/LG+7MTa4Pvh1rrwq8w9yVmjt0FiNwEqNz/6YU1eKyL1DSZ/2+9L7778WQ+1+T0i8p4vdQ2eyB/CvVA7N164fY2xMq5MWmo8j7qcwKYq/czXJhkNnpkjTNi5QWZbBfcimYfVAOuvUrUK2phC2dJ16xkNs9g8j3c1JnajRPrBP3IKFklYmvg8+Pg9DbacjTpfF7k/VfxxX1Af0RK0d8FdBL75N7GUOTAK3RFSbJ4HrynWp3Of+ZL5f60S73+Zn172xOT86Dnnf9l/O3mJ+MVeHxgYHyKx8JTjahOsq0VR5ZXFD6qtkHZDmqh8DivId+5Od5z2mTv80IqFdR1lt3ckPJT0bNLhobTGOftCP09JPMvvETW5ko/XMorWNnygmC/59kh8VWr5RRTbWLCIknMJI/9CaTWPBrg+pEopIkChXuIO7XQ4lwgVJm1fcItV8deounodX6d8Re0tS9xigMWBuwiUZ9YVrlURAcCypmSfbfqRQDGjhEpB5/917QLu3RGCaqdUE9b6AbI/Kwg4hXQLhZG6mPbWSseRP3PWqJ3d1FWwx9s4Q== 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: Now that run_vmtests.sh does not guarantee that the correct hugepage count is available, skip the hugetlb-madvise test if the requirements are not met rather than failing. Signed-off-by: Nico Pache --- tools/testing/selftests/mm/hugetlb-madvise.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/hugetlb-madvise.c b/tools/testing/selftests/mm/hugetlb-madvise.c index f32d99565c5ea..e74107185324f 100644 --- a/tools/testing/selftests/mm/hugetlb-madvise.c +++ b/tools/testing/selftests/mm/hugetlb-madvise.c @@ -19,6 +19,7 @@ #include #include #include "vm_util.h" +#include "../kselftest.h" #define MIN_FREE_PAGES 20 #define NR_HUGE_PAGES 10 /* common number of pages to map/allocate */ @@ -78,7 +79,7 @@ int main(int argc, char **argv) free_hugepages = get_free_hugepages(); if (free_hugepages < MIN_FREE_PAGES) { printf("Not enough free huge pages to test, exiting!\n"); - exit(1); + exit(KSFT_SKIP); } fd = memfd_create(argv[0], MFD_HUGETLB);