From nobody Tue Apr 7 16:14: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 25DED390216 for ; Thu, 12 Mar 2026 11:40:58 +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=1773315661; cv=none; b=OrbW56NIWD/PJ3lRUXQCFMemJ1n5wF/V8hbqNeP45IfLzRN9oT/xINSVzpvpAcFOu+Uu1aRdILAlUHp7/z61uJrl6+Ob5C1xWcFQVOwBuZ5nFHrxJQBL+cLu//456rAQevtq9L222eCPLtpRdvPsT2G4uJWH9bxPuW61HFLZzxA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773315661; c=relaxed/simple; bh=jH7Fen0vwsFiTlqBpdufHCwlg84kXvI5dx8Xozoa2gg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SEu2C5MCbMh3SkwMztEqFpQa8Bt0KCa3jVk0osDFs9DY3Hhqp/upRO15Qy0RAvkI8FiHIDrRARtZhB9+jyvLBZAceR8z2HhIa0wfbyHBMGUZuZdx8+0CJ5pdadCV924LwUFZGCIGhcPpeV6sCiuwD5tkRA6+0f/ZIYXhrRWSw2Y= 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=ibJKbbh8; 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="ibJKbbh8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773315658; 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=LeeUzwD9xvrgBKbuAuUTCtoCEVa+RZ+bhwLWLOTaBdA=; b=ibJKbbh8CCiL5QAc+zPTLqNOkmJMu54uMJ7/Meq4ENyeVwkG1J44MZhJrOzeKmZiBuQPn9 UxjyoCaka44S12AvB+ecTElH3C1Jyzy2adYoeDve4n+13EyCOsFVRZRxv6/XIE4QKKOkHJ v2cxWsFm8uSA3jHkbNmSFyN4gWt5xeE= 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-205-LtDIuIs8PaWgaGruvmlnmg-1; Thu, 12 Mar 2026 07:40:55 -0400 X-MC-Unique: LtDIuIs8PaWgaGruvmlnmg-1 X-Mimecast-MFC-AGG-ID: LtDIuIs8PaWgaGruvmlnmg_1773315652 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 2ECEC18002D1; Thu, 12 Mar 2026 11:40:52 +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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1694A180035F; Thu, 12 Mar 2026 11:40:41 +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: [RESEND PATCH 1/4] selftests/mm/guard-regions: skip collapse test when thp not enabled Date: Thu, 12 Mar 2026 19:40:24 +0800 Message-ID: <20260312114027.634559-2-chuhu@redhat.com> In-Reply-To: <20260312114027.634559-1-chuhu@redhat.com> References: <20260312114027.634559-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.4.1 on 10.30.177.111 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 CC: Li Wang Signed-off-by: Chunyu Hu Acked-by: David Hildenbrand (Arm) Reviewed-by: Lorenzo Stoakes (Oracle) Reviewed-by: Zi Yan --- 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); --=20 2.53.0 From nobody Tue Apr 7 16:14: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 6D7603A1699 for ; Thu, 12 Mar 2026 11:41:08 +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=1773315669; cv=none; b=q/vY5IBrjoWoFHBF8vXJpNI8zOn6VWOhgn+yQnlrVrdq86PwTc0OKdlKIXi2K6Lx0pr7jlc8+AA7QidJzJC5WCjnSHf2S8zRwKOuRpOky/JHbI5YWnNoTmR3lt4TKpo7lkLf3esR/O53ES4lvQR6X+iOhFgGxtPpMxnJdD/eFZc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773315669; c=relaxed/simple; bh=31FRBUDKUjDJ/8R/XWEZf1wT650CVByWqNbvkX4SOts=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WcywmINWLOfeyNXXnqvfC+E3tkUb9YSosiP4Z66LnBuZ9vBd6wZ8b0S6C/KnjqkukU82DVG8fEhud2gYPEuPN2aPnSlL9/6dZmBy47N2slximfIFruYKo/YKqRPjDnvpUkzpRGH/ZRaCXaSd+hqybp67D9GgXSNWJXvNaRZBh2E= 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=VYCyEcaj; 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="VYCyEcaj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773315667; 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=qAzmMPLcljhdY36zlJQtF6Ye0/UcSvjVdBQd2alsCao=; b=VYCyEcaju9ZD1qwJVi4hgfHQNA5RoYgGIbFMnI6UoytYrzwgGhUerU3xli+LwUj0XqwvEk QaS7lxl4d0HhxTn7Pja5dnsr/2zQgggl1sqDckJ61qDUYNOzCQBVxj0tdSIjjlbTH2wx1u dEDm85DkYNBYVUR0vaqbIpfA8HKPROc= Received: from mx-prod-mc-01.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-515-BN4trrCOMCqvLzYq7LIEJQ-1; Thu, 12 Mar 2026 07:41:04 -0400 X-MC-Unique: BN4trrCOMCqvLzYq7LIEJQ-1 X-Mimecast-MFC-AGG-ID: BN4trrCOMCqvLzYq7LIEJQ_1773315662 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ED2931953987; Thu, 12 Mar 2026 11:41:01 +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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E0430180058B; Thu, 12 Mar 2026 11:40:52 +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: [RESEND PATCH 2/4] selftests/mm: soft-dirty: skip two tests when thp is not available Date: Thu, 12 Mar 2026 19:40:25 +0800 Message-ID: <20260312114027.634559-3-chuhu@redhat.com> In-Reply-To: <20260312114027.634559-1-chuhu@redhat.com> References: <20260312114027.634559-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.4.1 on 10.30.177.111 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 CC: Li Wang Signed-off-by: Chunyu Hu Acked-by: David Hildenbrand (Arm) Reviewed-by: Lorenzo Stoakes (Oracle) Reviewed-by: Zi Yan --- 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 16:14: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 0CA2E39DBC3 for ; Thu, 12 Mar 2026 11:41:20 +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=1773315683; cv=none; b=cHjY3qXpDix2n+TEpkbE9045l2kAhIlnLuZ0BbKPRNmSrRzVddc1zL945bpi7Lm7uKOc2qSJqj2COR19QYLvrlBLodqVMPeuR1rIqkn/ZckykrkIMsPRVlIsSAQItsgqAy7G3liQxK7aqYT+cLu9pYHKt3fCAGRnHjVHPgz29tw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773315683; c=relaxed/simple; bh=9g8V5pG2xl1qxGcmympXzly6LC1lqeNauW6r+g0kqD0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WHH8Y2mvkn7hCgL0++FcOgSv6J0OUHAwmfm8gzaRGkFEgZhq2Eo+/7mPgmxPz0Pvl7tPbK2XPVV5qiUKk1NmCEf1xBZR2WJ+ND7vWHDZAWZwd4W9d+a4Q8zFFbCkmD+mr2QRtUvliafXKuoBfEzghGTMuQy/uNjYuW6rSOZcUwY= 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=JL6zEgox; 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="JL6zEgox" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773315680; 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=XwjhJxQ0ePsKl4AA80EzxONZrokAXIixovBJhdLwa/U=; b=JL6zEgoxPlbnWIY24H1wH91UvyMZ0HKn5yTW/sGqDDbSaPXUBiVxZ6bs3kt8TAwuhIQ3K5 Hk9i/d2KGprSmzLvA6PoGPGXsPBSNnE798+S/olV6Tk+rtC+hWKBgMRwAmVfiuzoTvk1by LCXlVGNZLrYTShrQAIE5lM3Vm+5ZVOo= 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-321-43TIW4ZPPuWWDee0nSai2w-1; Thu, 12 Mar 2026 07:41:15 -0400 X-MC-Unique: 43TIW4ZPPuWWDee0nSai2w-1 X-Mimecast-MFC-AGG-ID: 43TIW4ZPPuWWDee0nSai2w_1773315672 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 C1D8F18002E7; Thu, 12 Mar 2026 11:41:11 +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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B50E4180058B; Thu, 12 Mar 2026 11:41:02 +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: [RESEND PATCH 3/4] selftests/mm: split_huge_page_test: skip the test when thp is not available Date: Thu, 12 Mar 2026 19:40:26 +0800 Message-ID: <20260312114027.634559-4-chuhu@redhat.com> In-Reply-To: <20260312114027.634559-1-chuhu@redhat.com> References: <20260312114027.634559-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.4.1 on 10.30.177.111 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. There's a naming conflict on write_file() function, both thp_settings.h and split_huge_page_test.c define it. To make use of thp_is_enabled() helper in the thp_settings.h, rename this local write_file to safe_write_file to avoid the conflict. The reason to use 'safe_' is it does some error check. 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 CC: Li Wang Signed-off-by: Chunyu Hu Reviewed-by: Lorenzo Stoakes (Oracle) Reviewed-by: Zi Yan --- tools/testing/selftests/mm/split_huge_page_test.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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..615b75ca62cc 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; @@ -255,7 +256,7 @@ static int check_after_split_folio_orders(char *vaddr_s= tart, size_t len, return status; } =20 -static void write_file(const char *path, const char *buf, size_t buflen) +static void safe_write_file(const char *path, const char *buf, size_t bufl= en) { int fd; ssize_t numwritten; @@ -283,7 +284,7 @@ static void write_debugfs(const char *fmt, ...) if (ret >=3D INPUT_MAX) ksft_exit_fail_msg("%s: Debugfs input is too long\n", __func__); =20 - write_file(SPLIT_DEBUGFS, input, ret + 1); + safe_write_file(SPLIT_DEBUGFS, input, ret + 1); } =20 static char *allocate_zero_filled_hugepage(size_t len) @@ -772,6 +773,10 @@ 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 16:14: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 4437D39DBC3 for ; Thu, 12 Mar 2026 11:41:28 +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=1773315689; cv=none; b=T39oNX9dsgEU8IJpFgxhhdY9p1I0jrYwsNamuOKFLvj1tbSHuFQmpttjaMYndZT04y6+SXmuafCU8XmwlYzXiCqlSOFCXDRABPcD5JNcN1KFAj+PGAuAmsk7TkdT3tEgETyJ0gk8F61+ztDe7F39xASlhBobGoOlvb10/z3TgZQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773315689; c=relaxed/simple; bh=e0qvEWr+SSEH4j0vaCh0CP61XRiN4Et7YLSwqxXb7Ck=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DaWlRtP2eRX7iWX0qRE6sxZmDG5lN33dQkKsPGHxQCB4CMUHDQPLMR1spNmGHBI+OgqV7tEuQLJellgohssA4u+972/Iv+qCKcyh+Y5q95zUP6DcMYEu2rHgZv0UcDQUE1L1yzQuY3hDczrsejKPEb5rjySAp/lrcXum3oCWTo4= 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=UaU9qvf2; 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="UaU9qvf2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773315687; 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=3FFU11Mi0bBXwJKlMBJvhw89oPXuQQ6MnaqLH21R0oM=; b=UaU9qvf21kgZQRkMu4jkdvS9+Fbic6x2Y82RcV389wNzH36tPqz+ZA3CMk//W/P+DEzbFF J62mFQ9ifYC2JVjdJAdWMqdH2mNoYS6/39lywSMFz3jjXbjTBzNyJuLN08m6hXyJoPjYaw lgXad65qm9HcnpEdKizCzWfytvot9oc= Received: from mx-prod-mc-05.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-588-VTST2Oz3P6SVUz4tR9q3BQ-1; Thu, 12 Mar 2026 07:41:24 -0400 X-MC-Unique: VTST2Oz3P6SVUz4tR9q3BQ-1 X-Mimecast-MFC-AGG-ID: VTST2Oz3P6SVUz4tR9q3BQ_1773315681 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6072E195609F; Thu, 12 Mar 2026 11:41:21 +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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7D58C180035F; Thu, 12 Mar 2026 11:41:12 +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: [RESEND PATCH 4/4] selftests/mm: transhuge_stress: skip the test when thp not available Date: Thu, 12 Mar 2026 19:40:27 +0800 Message-ID: <20260312114027.634559-5-chuhu@redhat.com> In-Reply-To: <20260312114027.634559-1-chuhu@redhat.com> References: <20260312114027.634559-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.4.1 on 10.30.177.111 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 # -------------------------------- # 1..0 # SKIP Transparent Hugepages not available # [SKIP] ok 5 transhuge-stress -d 20 # SKIP CC: Li Wang Signed-off-by: Chunyu Hu Reviewed-by: Lorenzo Stoakes (Oracle) Reviewed-by: Zi Yan --- 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..76316696426d 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; @@ -35,6 +36,9 @@ int main(int argc, char **argv) int pagemap_fd; int duration =3D 0; =20 + if (!thp_is_enabled()) + ksft_exit_skip("Transparent Hugepages not available\n"); + ksft_print_header(); =20 ram =3D sysconf(_SC_PHYS_PAGES); --=20 2.53.0