From nobody Tue Apr 7 04:39:58 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E126835949 for ; Mon, 16 Mar 2026 04:44:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773636249; cv=none; b=ZgI+fJAqgPe+AtjMbxdn9BaPPsB306fAiASuKDbxD0Wd5IujY+oI/YtDkhpFxstzidcm2XIGghrpcheqZvB/Jq9xAIY9yKu1KCAx1VT7YNpCTMayKsOiUX2Y9SwVI6bM49rbDS5XCCdHJtWqOuuAbhmRYppBNF330vlsybd4DBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773636249; c=relaxed/simple; bh=uZsOlCM8eZ/P7EcpQCXUQJOYm4UtVBsO6fbeUS3+gJw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VOnQ/YtsKMaRxgEitTFrKenmYxzdz2nZqYamTDLrCI2JjmnBacy9LkcZRy5/ufjxS5S+4JZSk63+bMe7nsZkTEVy5jRWkIUSbgzhogji3evK4pMOPcrCtaxf9CJT4sm31OfWyi4qjKUpV5EUcK9FkyuIdIAlySh37C9ANS9YTNo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Kk4g3Pti; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Kk4g3Pti" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773636247; 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=2x6ia0fOtjNFpMwFjrWEQ0OzFaYrAPdncllfx5wNUeo=; b=Kk4g3PtiukrbE4cSR8QAgNlXFfk+bCoHNnOwnPVkHrpi1M+Nhz2IPvSavAr9YjDqtkivIP 6HBSHn5c6uDV31wbqxdJTZAlz8xJ0TRHjPEnzpOFY3B5GQZJp76b+wsIULb9x0U0vRFq7q coCI5S8OE+XBLxEHvKX5Xshv1b4yp74= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-441-V2YXIBYvOvuT3hqnEv4IEA-1; Mon, 16 Mar 2026 00:44:02 -0400 X-MC-Unique: V2YXIBYvOvuT3hqnEv4IEA-1 X-Mimecast-MFC-AGG-ID: V2YXIBYvOvuT3hqnEv4IEA_1773636240 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 907C119560B5; Mon, 16 Mar 2026 04:43:59 +0000 (UTC) Received: from dell-per7425-02.rhts.eng.pek2.redhat.com (dell-per7425-02.rhts.eng.pek2.redhat.com [10.73.116.18]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4B3571955E75; Mon, 16 Mar 2026 04:43:49 +0000 (UTC) From: Chunyu Hu To: akpm@linux-foundation.org, david@kernel.org, shuah@kernel.org, linux-mm@kvack.org, ljs@kernel.org Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, ziy@nvidia.com, baolin.wang@linux.alibaba.com, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, lance.yang@linux.dev, chuhu@redhat.com, Li Wang Subject: [PATCH v2 1/5] selftests/mm/guard-regions: skip collapse test when thp not enabled Date: Mon, 16 Mar 2026 12:43:31 +0800 Message-ID: <20260316044335.1390608-2-chuhu@redhat.com> In-Reply-To: <20260316044335.1390608-1-chuhu@redhat.com> References: <20260316044335.1390608-1-chuhu@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Content-Type: text/plain; charset="utf-8" When thp is not available, just skip the collape tests to avoid the false positive. Without the change, run with a thp disabled kernel: ./run_vmtests.sh -t madv_guard # # RUN guard_regions.file.multi_vma ... # # OK guard_regions.file.multi_vma # ok 89 guard_regions.file.multi_vma # # RUN guard_regions.file.basic ... # # OK guard_regions.file.basic # ok 90 guard_regions.file.basic # # FAILED: 87 / 90 tests passed. # # 17 skipped test(s) detected. Consider enabling relevant config option= s to improve coverage. # # Totals: pass:70 fail:3 xfail:0 xpass:0 skip:17 error:0 # [FAIL] not ok 1 guard-regions # exit=3D1 hwpoison_inject # SUMMARY: PASS=3D0 SKIP=3D0 FAIL=3D1 With this change, run with thp disabled kernel: ./run_vmtests.sh -t madv_guard # ok 90 guard_regions.file.basic # # PASSED: 90 / 90 tests passed. # # 20 skipped test(s) detected. Consider enabling relevant config option= s to improve coverage. # # Totals: pass:70 fail:0 xfail:0 xpass:0 skip:20 error:0 # [PASS] ok 1 guard-regions hwpoison_inject # SUMMARY: PASS=3D1 SKIP=3D0 FAIL=3D0 1..1 Reviewed-by: Lorenzo Stoakes (Oracle) Acked-by: David Hildenbrand (Arm) Reviewed-by: Zi Yan CC: Li Wang Signed-off-by: Chunyu Hu Reviewed-by: Mike Rapoport (Microsoft) --- Changes in v2: - add reviewed by from Zi and Lorenzo - add acked-by from David --- tools/testing/selftests/mm/guard-regions.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/mm/guard-regions.c b/tools/testing/sel= ftests/mm/guard-regions.c index dbd21d66d383..897af9c512f9 100644 --- a/tools/testing/selftests/mm/guard-regions.c +++ b/tools/testing/selftests/mm/guard-regions.c @@ -21,6 +21,7 @@ #include #include #include "vm_util.h" +#include "thp_settings.h" =20 #include "../pidfd/pidfd.h" =20 @@ -2195,6 +2196,9 @@ TEST_F(guard_regions, collapse) char *ptr; int i; =20 + if (!thp_is_enabled()) + SKIP(return, "Transparent Hugepages not available\n"); + /* Need file to be correct size for tests for non-anon. */ if (variant->backing !=3D ANON_BACKED) ASSERT_EQ(ftruncate(self->fd, size), 0); base-commit: f338e77383789c0cae23ca3d48adcc5e9e137e3c --=20 2.53.0 From nobody Tue Apr 7 04:39:58 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7747B320393 for ; Mon, 16 Mar 2026 04:44:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773636256; cv=none; b=p0MSQ687vnTSqUe3EPEK61JCvsGHqA+8YupXd9/agnYAfUGnsr0cnjFjCCDt6mUJU7uVH8rfcEH6Kf/XEIgyColT4nH8FAkjSr5ILu6nh2kSow789t8ZIYVh9n6ak6wSl3GQtrMhgUfPIcTahEK2uoJ+WKUSqCSVEg2/WpPA/8g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773636256; c=relaxed/simple; bh=zhfRwvktEFbZNAGP6IWPgWCro9pMmybpSK0ZbziHp8I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P5j8vsdnerGFFL7hJtq2ptgUoFFZbn+Q2JxxuuU4CJxGHR6V9i7OI/CX3Ppv/zVq8mgK1IUtRuqrljyzPgS5YuRvH+HGln1rBXZEbmfqGiCoPqcnKe1kczsbdaTwWkvaqNAmLQrlWmqTAvx1e7Pxum81C6ieDid9PLrBaQBT9BI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=IfJTo5LO; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IfJTo5LO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773636254; 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=J+5vIvfueq6IMhLJl1sQj/A9x+kVAV9b++ZY+Mb8ytI=; b=IfJTo5LOrPgq86BkljzzCsYdh88u5ZNUwmxnO9+geRyj7GiS2ElTrFcyiErFXWwsXxybmX f2GLQb2ku1KHhC76NxzPsZR5HMvBOUcpHZCr9RYFAk5afJwVrSSJ6wRasoM8L8FMdI2ujC 22vHgGeKB2GTH38xwg99zcY7R0S6IQ0= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-412-8OuO6jwKNUyHHMlH86adPw-1; Mon, 16 Mar 2026 00:44:11 -0400 X-MC-Unique: 8OuO6jwKNUyHHMlH86adPw-1 X-Mimecast-MFC-AGG-ID: 8OuO6jwKNUyHHMlH86adPw_1773636248 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 93CBB180044D; Mon, 16 Mar 2026 04:44:08 +0000 (UTC) Received: from dell-per7425-02.rhts.eng.pek2.redhat.com (dell-per7425-02.rhts.eng.pek2.redhat.com [10.73.116.18]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4D8881955E80; Mon, 16 Mar 2026 04:43:59 +0000 (UTC) From: Chunyu Hu To: akpm@linux-foundation.org, david@kernel.org, shuah@kernel.org, linux-mm@kvack.org, ljs@kernel.org Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, ziy@nvidia.com, baolin.wang@linux.alibaba.com, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, lance.yang@linux.dev, chuhu@redhat.com, Li Wang Subject: [PATCH v2 2/5] selftests/mm: soft-dirty: skip two tests when thp is not available Date: Mon, 16 Mar 2026 12:43:32 +0800 Message-ID: <20260316044335.1390608-3-chuhu@redhat.com> In-Reply-To: <20260316044335.1390608-1-chuhu@redhat.com> References: <20260316044335.1390608-1-chuhu@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Content-Type: text/plain; charset="utf-8" The test_hugepage test contain two sub tests. If just reporting one skip when thp not available, there will be error in the log because the test count don't match the test plan. Change to skip two tests by running the ksft_test_result_skip twice in this case. Without the fix (run test on thp disabled kernel): ./run_vmtests.sh -t soft_dirty # -------------------- # running ./soft-dirty # -------------------- # TAP version 13 # 1..19 # ok 1 Test test_simple # ok 2 Test test_vma_reuse dirty bit of allocated page # ok 3 Test test_vma_reuse dirty bit of reused address page # ok 4 # SKIP Transparent Hugepages not available # ok 5 Test test_mprotect-anon dirty bit of new written page # ok 6 Test test_mprotect-anon soft-dirty clear after clear_refs # ok 7 Test test_mprotect-anon soft-dirty clear after marking RO # ok 8 Test test_mprotect-anon soft-dirty clear after marking RW # ok 9 Test test_mprotect-anon soft-dirty after rewritten # ok 10 Test test_mprotect-file dirty bit of new written page # ok 11 Test test_mprotect-file soft-dirty clear after clear_refs # ok 12 Test test_mprotect-file soft-dirty clear after marking RO # ok 13 Test test_mprotect-file soft-dirty clear after marking RW # ok 14 Test test_mprotect-file soft-dirty after rewritten # ok 15 Test test_merge-anon soft-dirty after remap merge 1st pg # ok 16 Test test_merge-anon soft-dirty after remap merge 2nd pg # ok 17 Test test_merge-anon soft-dirty after mprotect merge 1st pg # ok 18 Test test_merge-anon soft-dirty after mprotect merge 2nd pg # # 1 skipped test(s) detected. Consider enabling relevant config options= to improve coverage. # # Planned tests !=3D run tests (19 !=3D 18) # # Totals: pass:17 fail:0 xfail:0 xpass:0 skip:1 error:0 # [FAIL] not ok 52 soft-dirty # exit=3D1 With the fix (run test on thp disabled kernel): ./run_vmtests.sh -t soft_dirty # -------------------- # running ./soft-dirty # TAP version 13 # -------------------- # running ./soft-dirty # -------------------- # TAP version 13 # 1..19 # ok 1 Test test_simple # ok 2 Test test_vma_reuse dirty bit of allocated page # ok 3 Test test_vma_reuse dirty bit of reused address page # # Transparent Hugepages not available # ok 4 # SKIP Test test_hugepage huge page allocation # ok 5 # SKIP Test test_hugepage huge page dirty bit # ok 6 Test test_mprotect-anon dirty bit of new written page # ok 7 Test test_mprotect-anon soft-dirty clear after clear_refs # ok 8 Test test_mprotect-anon soft-dirty clear after marking RO # ok 9 Test test_mprotect-anon soft-dirty clear after marking RW # ok 10 Test test_mprotect-anon soft-dirty after rewritten # ok 11 Test test_mprotect-file dirty bit of new written page # ok 12 Test test_mprotect-file soft-dirty clear after clear_refs # ok 13 Test test_mprotect-file soft-dirty clear after marking RO # ok 14 Test test_mprotect-file soft-dirty clear after marking RW # ok 15 Test test_mprotect-file soft-dirty after rewritten # ok 16 Test test_merge-anon soft-dirty after remap merge 1st pg # ok 17 Test test_merge-anon soft-dirty after remap merge 2nd pg # ok 18 Test test_merge-anon soft-dirty after mprotect merge 1st pg # ok 19 Test test_merge-anon soft-dirty after mprotect merge 2nd pg # # 2 skipped test(s) detected. Consider enabling relevant config options= to improve coverage. # # Totals: pass:17 fail:0 xfail:0 xpass:0 skip:2 error:0 # [PASS] ok 1 soft-dirty hwpoison_inject # SUMMARY: PASS=3D1 SKIP=3D0 FAIL=3D0 1..1 Reviewed-by: Lorenzo Stoakes (Oracle) Acked-by: David Hildenbrand (Arm) Reviewed-by: Zi Yan CC: Li Wang Signed-off-by: Chunyu Hu Reviewed-by: Mike Rapoport (Microsoft) --- Changes in v2: - add reviewed by from Lorenzo and Zi - add acked-by from David --- tools/testing/selftests/mm/soft-dirty.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/soft-dirty.c b/tools/testing/selfte= sts/mm/soft-dirty.c index 59c0dbe99a9b..bcfcac99b436 100644 --- a/tools/testing/selftests/mm/soft-dirty.c +++ b/tools/testing/selftests/mm/soft-dirty.c @@ -82,7 +82,9 @@ static void test_hugepage(int pagemap_fd, int pagesize) int i, ret; =20 if (!thp_is_enabled()) { - ksft_test_result_skip("Transparent Hugepages not available\n"); + ksft_print_msg("Transparent Hugepages not available\n"); + ksft_test_result_skip("Test %s huge page allocation\n", __func__); + ksft_test_result_skip("Test %s huge page dirty bit\n", __func__); return; } =20 --=20 2.53.0 From nobody Tue Apr 7 04:39:58 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52D2733A031 for ; Mon, 16 Mar 2026 04:44:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773636265; cv=none; b=YYKQ2T3RcXmMbWflFE/DDLgGzFI/M1nAb3kSyFAuNfk+GwZzE6tWkRIekiLdF8nWjbuIcWdtgFsZd7enFj98W8hv034Nh8ANy02bbBE9auox+BImFWyD0Yjuouwp7DXvV66RkeALHNepPXzHXjPAmUGDWOpr/iY8W6KG8/7le3E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773636265; c=relaxed/simple; bh=qGhnEep0RBSzZ0dq8guG7AmCL7nWwSAsr5IYP1RjcoU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MSOJHDZ5kFnTJhchimKjfnz98J0IT7Y+NAyavNl8qVXI7KsRy0QDNht6fSa5nAvfmqGEokJVpqx3yWHX6mFCVzQCsHZFonKvEifzcBS3nC+5VpX1NxDlVGQyd2qGCZUSzSFlczZixoq4GzyFFsbSCcnUzYuTJ2GShLrEvTV6owk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=gH3hq2le; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gH3hq2le" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773636263; 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=f0kOdSCeg55Ok0Trt0Fwz3GMewBTQG5BCQViHUjgEfw=; b=gH3hq2lefiBdpDMESBYFeDABbIoo29EywO8P3C4diDWnVhYiKqnwU1C9JZZE8sg1jgAqsq v5mSYp2AkOytd3/UB0Y+liZMgpmvwbtVbTy3uahY9L2BlU5hFYIJye53aJWd4ZCyHkpsuq hH1ujiA+FB+lDUwRghwz3p9nzWG1MDo= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-12-u9wUhbjxMVecISbYFoBuJA-1; Mon, 16 Mar 2026 00:44:19 -0400 X-MC-Unique: u9wUhbjxMVecISbYFoBuJA-1 X-Mimecast-MFC-AGG-ID: u9wUhbjxMVecISbYFoBuJA_1773636257 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E867E19373D8; Mon, 16 Mar 2026 04:44:16 +0000 (UTC) Received: from dell-per7425-02.rhts.eng.pek2.redhat.com (dell-per7425-02.rhts.eng.pek2.redhat.com [10.73.116.18]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4748319560B7; Mon, 16 Mar 2026 04:44:08 +0000 (UTC) From: Chunyu Hu To: akpm@linux-foundation.org, david@kernel.org, shuah@kernel.org, linux-mm@kvack.org, ljs@kernel.org Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, ziy@nvidia.com, baolin.wang@linux.alibaba.com, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, lance.yang@linux.dev, chuhu@redhat.com Subject: [PATCH v2 3/5] selftests/mm: move write_file helper to vm_util Date: Mon, 16 Mar 2026 12:43:33 +0800 Message-ID: <20260316044335.1390608-4-chuhu@redhat.com> In-Reply-To: <20260316044335.1390608-1-chuhu@redhat.com> References: <20260316044335.1390608-1-chuhu@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Content-Type: text/plain; charset="utf-8" thp_settings provides write_file() helper for safely writing to a file and exit when write failure happens. It's a very low level helper and many sub tests need such a helper, not only thp tests. split_huge_page_test also defines a write_file locally. The two have minior differences in return type and used exit api. And there would be conflicts if split_huge_page_test wanted to include thp_settings.h because of different prototype, making it less convenient. It's possisble to merge the two, although some tests don't use the kselftest infrastrucutre for testing. It would also work when using the ksft_exit_msg() to exit in my test, as the counters are all zero. Output will be like: TAP version 13 1..62 Bail out! /proc/sys/vm/drop_caches1 open failed: No such file or directory # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:0 error:0 So here just leave one version of write_file, and move it into the vm_util. This make it easy to maitain and user could just include one vm_util.h when then don't need thp setting helpers. Keep the prototype of returning the written bytes num. Suggested-by: Mike Rapoport Signed-off-by: Chunyu Hu --- Changes in v2: new patch from v2 --- .../selftests/mm/split_huge_page_test.c | 15 ------------ tools/testing/selftests/mm/thp_settings.c | 24 +------------------ tools/testing/selftests/mm/thp_settings.h | 1 - tools/testing/selftests/mm/vm_util.c | 16 +++++++++++++ tools/testing/selftests/mm/vm_util.h | 2 ++ 5 files changed, 19 insertions(+), 39 deletions(-) diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/test= ing/selftests/mm/split_huge_page_test.c index e0167111bdd1..93f205327b84 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -255,21 +255,6 @@ static int check_after_split_folio_orders(char *vaddr_= start, size_t len, return status; } =20 -static void write_file(const char *path, const char *buf, size_t buflen) -{ - int fd; - ssize_t numwritten; - - fd =3D open(path, O_WRONLY); - if (fd =3D=3D -1) - ksft_exit_fail_msg("%s open failed: %s\n", path, strerror(errno)); - - numwritten =3D write(fd, buf, buflen - 1); - close(fd); - if (numwritten < 1) - ksft_exit_fail_msg("Write failed\n"); -} - static void write_debugfs(const char *fmt, ...) { char input[INPUT_MAX]; diff --git a/tools/testing/selftests/mm/thp_settings.c b/tools/testing/self= tests/mm/thp_settings.c index 574bd0f8ae48..02de28ecf31a 100644 --- a/tools/testing/selftests/mm/thp_settings.c +++ b/tools/testing/selftests/mm/thp_settings.c @@ -6,6 +6,7 @@ #include #include =20 +#include "vm_util.h" #include "thp_settings.h" =20 #define THP_SYSFS "/sys/kernel/mm/transparent_hugepage/" @@ -64,29 +65,6 @@ int read_file(const char *path, char *buf, size_t buflen) return (unsigned int) numread; } =20 -int write_file(const char *path, const char *buf, size_t buflen) -{ - int fd; - ssize_t numwritten; - - fd =3D open(path, O_WRONLY); - if (fd =3D=3D -1) { - printf("open(%s)\n", path); - exit(EXIT_FAILURE); - return 0; - } - - numwritten =3D write(fd, buf, buflen - 1); - close(fd); - if (numwritten < 1) { - printf("write(%s)\n", buf); - exit(EXIT_FAILURE); - return 0; - } - - return (unsigned int) numwritten; -} - unsigned long read_num(const char *path) { char buf[21]; diff --git a/tools/testing/selftests/mm/thp_settings.h b/tools/testing/self= tests/mm/thp_settings.h index 76eeb712e5f1..7748a9009191 100644 --- a/tools/testing/selftests/mm/thp_settings.h +++ b/tools/testing/selftests/mm/thp_settings.h @@ -63,7 +63,6 @@ struct thp_settings { }; =20 int read_file(const char *path, char *buf, size_t buflen); -int write_file(const char *path, const char *buf, size_t buflen); unsigned long read_num(const char *path); void write_num(const char *path, unsigned long num); =20 diff --git a/tools/testing/selftests/mm/vm_util.c b/tools/testing/selftests= /mm/vm_util.c index a6d4ff7dfdc0..b4b3b48f8dc9 100644 --- a/tools/testing/selftests/mm/vm_util.c +++ b/tools/testing/selftests/mm/vm_util.c @@ -764,3 +764,19 @@ int unpoison_memory(unsigned long pfn) =20 return ret > 0 ? 0 : -errno; } + +unsigned int write_file(const char *path, const char *buf, size_t buflen) +{ + int fd; + ssize_t numwritten; + + fd =3D open(path, O_WRONLY); + if (fd =3D=3D -1) + ksft_exit_fail_msg("%s open failed: %s\n", path, strerror(errno)); + + numwritten =3D write(fd, buf, buflen - 1); + close(fd); + if (numwritten < 1) + ksft_exit_fail_msg("Write failed\n"); + return (unsigned int) numwritten; +} diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests= /mm/vm_util.h index e9c4e24769c1..22c8805e0d7a 100644 --- a/tools/testing/selftests/mm/vm_util.h +++ b/tools/testing/selftests/mm/vm_util.h @@ -166,3 +166,5 @@ int unpoison_memory(unsigned long pfn); =20 #define PAGEMAP_PRESENT(ent) (((ent) & (1ull << 63)) !=3D 0) #define PAGEMAP_PFN(ent) ((ent) & ((1ull << 55) - 1)) + +unsigned int write_file(const char *path, const char *buf, size_t buflen); --=20 2.53.0 From nobody Tue Apr 7 04:39:58 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8F8333A9D1 for ; Mon, 16 Mar 2026 04:44:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773636274; cv=none; b=JDsokSq4d0sCX/CR7cCD2HgFq/5L/X+3WYgj/GCoMKSWGt8h2pCLgku3bGTEITpNOAbtWUOCowCLregQREyeoT+RlUSgOXq/k5F0FjkjPXwqOvcijSx0zRJF18NIQ7cDxwr13V0KVxZ+ADXw451BK5VLo82XhfkP1RmZt+/PCIw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773636274; c=relaxed/simple; bh=tl4e/hllgDwGpxF/EJFB+6lFNQMKiHd/fK3Epal7VfU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LgoT6521rIGYtKKp3UWIA5MfEx5H4aN4jk55NdZV+WFkPV2ooypLEK7hf7qysk7E+mB02zXhtSSv6CUlktB0Zvf2j0p1Jo/+z8oyBVax7LMhpZPYB2ed9AH+E2rXcXl1HQ7+wWFky55lPg7jz+ti0vp1gB3uIodtXyzG2sucYn8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=XJH26BIO; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="XJH26BIO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773636271; 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=IGvRhuyuajIbkQZn3epkDu7JWhW7+TuEmP6Npdox41U=; b=XJH26BIOP6On55wK3diZbVpNfPX8uZyiJgOBbT0Ehho6JwukZjmFR9vfhSXCGLkimgKxJh m84iJQvxPTpreddMebg4obwCEfFQrZidwyPAgtasYjCnAkhMGBptXrMJUlPmvuteI7CneJ J7v+/0owbFosiUmZwdM088NBaBGEqcY= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-678-MmNkOmaHNyOUlOocgK9N_A-1; Mon, 16 Mar 2026 00:44:28 -0400 X-MC-Unique: MmNkOmaHNyOUlOocgK9N_A-1 X-Mimecast-MFC-AGG-ID: MmNkOmaHNyOUlOocgK9N_A_1773636266 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DC3E4180049D; Mon, 16 Mar 2026 04:44:25 +0000 (UTC) Received: from dell-per7425-02.rhts.eng.pek2.redhat.com (dell-per7425-02.rhts.eng.pek2.redhat.com [10.73.116.18]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9091519560B7; Mon, 16 Mar 2026 04:44:17 +0000 (UTC) From: Chunyu Hu To: akpm@linux-foundation.org, david@kernel.org, shuah@kernel.org, linux-mm@kvack.org, ljs@kernel.org Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, ziy@nvidia.com, baolin.wang@linux.alibaba.com, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, lance.yang@linux.dev, chuhu@redhat.com, Li Wang Subject: [PATCH v2 4/5] selftests/mm: split_huge_page_test: skip the test when thp is not available Date: Mon, 16 Mar 2026 12:43:34 +0800 Message-ID: <20260316044335.1390608-5-chuhu@redhat.com> In-Reply-To: <20260316044335.1390608-1-chuhu@redhat.com> References: <20260316044335.1390608-1-chuhu@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Content-Type: text/plain; charset="utf-8" When thp is not enabled on some kernel config such as realtime kernel, the test will report failure. Fix the false positive by skipping the test directly when thp is not enabled. Tested with thp disabled kernel: Before The fix: # -------------------------------------------------- # running ./split_huge_page_test /tmp/xfs_dir_Ywup9p # -------------------------------------------------- # TAP version 13 # Bail out! Reading PMD pagesize failed # # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:0 error:0 # [FAIL] not ok 61 split_huge_page_test /tmp/xfs_dir_Ywup9p # exit=3D1 After the fix: # -------------------------------------------------- # running ./split_huge_page_test /tmp/xfs_dir_YHPUPl # -------------------------------------------------- # TAP version 13 # 1..0 # SKIP Transparent Hugepages not available # [SKIP] ok 6 split_huge_page_test /tmp/xfs_dir_YHPUPl # SKIP Reviewed-by: Lorenzo Stoakes (Oracle) Reviewed-by: Zi Yan CC: Li Wang Signed-off-by: Chunyu Hu Acked-by: David Hildenbrand (Arm) Reviewed-by: Mike Rapoport (Microsoft) --- V2 changes: - removed the {} in if block - removed the write_file helper rename chunk, as there's a new patch 3 to resolve the conflict with thp_settings.h by moving it to vm_util. - Add reviewed by from Zi and Lorenzo --- tools/testing/selftests/mm/split_huge_page_test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/test= ing/selftests/mm/split_huge_page_test.c index 93f205327b84..500d07c4938b 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -21,6 +21,7 @@ #include #include "vm_util.h" #include "kselftest.h" +#include "thp_settings.h" =20 uint64_t pagesize; unsigned int pageshift; @@ -757,6 +758,9 @@ int main(int argc, char **argv) ksft_finished(); } =20 + if (!thp_is_enabled()) + ksft_exit_skip("Transparent Hugepages not available\n"); + if (argc > 1) optional_xfs_path =3D argv[1]; =20 --=20 2.53.0 From nobody Tue Apr 7 04:39:58 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5FD833A9D1 for ; Mon, 16 Mar 2026 04:44:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773636283; cv=none; b=uSPJOl8LuyskRPZqyQG9mrx6Zxosjn4s4JCzGJ9wYoL1AGxD7TKZfTh4Zq9zh1M02+7O8loj4iEmx25p0FfR04ksjVqLHUDUaEO3tawLlrSLC5Oi7n11NpG2QvmDMEMq+vQ6ZB/rnmcwk9hKnf8HJsk4w0WXJzpYUYllQ1sVwPs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773636283; c=relaxed/simple; bh=JHYNOgg1EKqT6k0vaVSLWP3VZdNs5XpkE/XalqOPBOk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PGyoCa33NEJa3LHsxyMuq7ROHEMX88KTlO1mmc7qqRgZZCFe9VVwFOWkC06tXQ449QzANOCtvYr61CWGsEZDnGw3E+GIdxXZyk5nO0gh7Fp89DSraJnscphYdDGxsERQNTH/lvejVEeEfYJNR4vdifVS3xQ9nTITm7C8AaNP94w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=RxqrWLvD; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RxqrWLvD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773636281; 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=tcVcRvBzVtTBY3hfLbgONkTdIQJJ/qtR9JdltENskko=; b=RxqrWLvDz+CVx9L+cty2u7b5Yxk+w4jJI4ziWLNbf9q7qSAO8rC0VdQuBezMFr/nLWk8Zs 1bXwT5dO7hCAARDwIHbU/+PkzFztrNpbGo29Lp9jUx1JW5lzocodGQxPHisBtDDZBwLtA0 mvLwQpI2ZlhceK6IBN5JbSDnmKp12ag= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-5-AA6dxcJNMZWoz4jPtcyc7A-1; Mon, 16 Mar 2026 00:44:37 -0400 X-MC-Unique: AA6dxcJNMZWoz4jPtcyc7A-1 X-Mimecast-MFC-AGG-ID: AA6dxcJNMZWoz4jPtcyc7A_1773636275 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CF726180034F; Mon, 16 Mar 2026 04:44:34 +0000 (UTC) Received: from dell-per7425-02.rhts.eng.pek2.redhat.com (dell-per7425-02.rhts.eng.pek2.redhat.com [10.73.116.18]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8F5051955E80; Mon, 16 Mar 2026 04:44:26 +0000 (UTC) From: Chunyu Hu To: akpm@linux-foundation.org, david@kernel.org, shuah@kernel.org, linux-mm@kvack.org, ljs@kernel.org Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, ziy@nvidia.com, baolin.wang@linux.alibaba.com, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, lance.yang@linux.dev, chuhu@redhat.com, Li Wang Subject: [PATCH v2 5/5] selftests/mm: transhuge_stress: skip the test when thp not available Date: Mon, 16 Mar 2026 12:43:35 +0800 Message-ID: <20260316044335.1390608-6-chuhu@redhat.com> In-Reply-To: <20260316044335.1390608-1-chuhu@redhat.com> References: <20260316044335.1390608-1-chuhu@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Content-Type: text/plain; charset="utf-8" The test requires thp, skip the test when thp is not available to avoid false positive. Tested with thp disabled kernel. Before the fix: # -------------------------------- # running ./transhuge-stress -d 20 # -------------------------------- # TAP version 13 # 1..1 # transhuge-stress: allocate 1453 transhuge pages, using 2907 MiB virtual= memory and 11 MiB of ram # Bail out! MADV_HUGEPAGE# Planned tests !=3D run tests (1 !=3D 0) # # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:0 error:0 # [FAIL] not ok 60 transhuge-stress -d 20 # exit=3D1 After the fix: # -------------------------------- # running ./transhuge-stress -d 20 # -------------------------------- # TAP version 13 # 1..0 # SKIP Transparent Hugepages not available # [SKIP] ok 5 transhuge-stress -d 20 # SKIP Reviewed-by: Lorenzo Stoakes (Oracle) Reviewed-by: Zi Yan CC: Li Wang Signed-off-by: Chunyu Hu Acked-by: David Hildenbrand (Arm) Reviewed-by: Mike Rapoport (Microsoft) --- V2 changes: - Move the exit chunk to the front of ksft_print_headers() as suggested by David. - Add reviewed by from Zi and Lorenzo --- tools/testing/selftests/mm/transhuge-stress.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/mm/transhuge-stress.c b/tools/testing/= selftests/mm/transhuge-stress.c index bcad47c09518..7a9f1035099b 100644 --- a/tools/testing/selftests/mm/transhuge-stress.c +++ b/tools/testing/selftests/mm/transhuge-stress.c @@ -17,6 +17,7 @@ #include #include "vm_util.h" #include "kselftest.h" +#include "thp_settings.h" =20 int backing_fd =3D -1; int mmap_flags =3D MAP_ANONYMOUS | MAP_NORESERVE | MAP_PRIVATE; @@ -37,6 +38,9 @@ int main(int argc, char **argv) =20 ksft_print_header(); =20 + if (!thp_is_enabled()) + ksft_exit_skip("Transparent Hugepages not available\n"); + ram =3D sysconf(_SC_PHYS_PAGES); if (ram > SIZE_MAX / psize() / 4) ram =3D SIZE_MAX / 4; --=20 2.53.0