Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 6.1.y] selftests/vm: fix split huge page tests
@ 2025-05-28  8:54 wndgwang4
  2025-05-29 11:39 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: wndgwang4 @ 2025-05-28  8:54 UTC (permalink / raw)
  To: guangming.wang
  Cc: stable, Zi Yan, Zach O'Keefe, David Hildenbrand,
	Andrew Morton

From: Zi Yan <ziy@nvidia.com>

[ upstream commit dd63bd7df41a8f9393a2e3ff9157a441c08eb996  ]

Fix two inputs to check_anon_huge() and one if condition, so the tests
work as expected.

Steps to reproduce the issue.
make headers
make -C tools/testing/selftests/vm

Before patching:test fails with a non-zero exit code
~/linux$ sudo tools/testing/selftests/vm/split_huge_page_test | echo 0
2
~/linux$ sudo tools/testing/selftests/vm/split_huge_page_test
No THP is allocated

After patching:
~/linux$ sudo tools/testing/selftests/vm/split_huge_page_test | echo 0
0
~/linux$ sudo tools/testing/selftests/vm/split_huge_page_test
Split huge pages successful
...

Link: https://lkml.kernel.org/r/20230306160907.16804-1-zi.yan@sent.com
Fixes: c07c343cda8e ("selftests/vm: dedup THP helpers")
Cc: stable@vger.kernel.org
Signed-off-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Zach O'Keefe <zokeefe@google.com>
Tested-by: Zach O'Keefe <zokeefe@google.com>
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: wndgwang4 <guangming.wang@windriver.com>
---
 tools/testing/selftests/vm/split_huge_page_test.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/vm/split_huge_page_test.c b/tools/testing/selftests/vm/split_huge_page_test.c
index 76e1c36dd..b8558c7f1 100644
--- a/tools/testing/selftests/vm/split_huge_page_test.c
+++ b/tools/testing/selftests/vm/split_huge_page_test.c
@@ -106,7 +106,7 @@ void split_pmd_thp(void)
 	for (i = 0; i < len; i++)
 		one_page[i] = (char)i;
 
-	if (!check_huge_anon(one_page, 1, pmd_pagesize)) {
+	if (!check_huge_anon(one_page, 4, pmd_pagesize)) {
 		printf("No THP is allocated\n");
 		exit(EXIT_FAILURE);
 	}
@@ -122,7 +122,7 @@ void split_pmd_thp(void)
 		}
 
 
-	if (check_huge_anon(one_page, 0, pmd_pagesize)) {
+	if (!check_huge_anon(one_page, 0, pmd_pagesize)) {
 		printf("Still AnonHugePages not split\n");
 		exit(EXIT_FAILURE);
 	}
@@ -169,7 +169,7 @@ void split_pte_mapped_thp(void)
 	for (i = 0; i < len; i++)
 		one_page[i] = (char)i;
 
-	if (!check_huge_anon(one_page, 1, pmd_pagesize)) {
+	if (!check_huge_anon(one_page, 4, pmd_pagesize)) {
 		printf("No THP is allocated\n");
 		exit(EXIT_FAILURE);
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 6.1.y] selftests/vm: fix split huge page tests
  2025-05-28  8:54 [PATCH 6.1.y] selftests/vm: fix split huge page tests wndgwang4
@ 2025-05-29 11:39 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2025-05-29 11:39 UTC (permalink / raw)
  To: wndgwang4
  Cc: stable, Zi Yan, Zach O'Keefe, David Hildenbrand,
	Andrew Morton

On Wed, May 28, 2025 at 04:54:40PM +0800, wndgwang4 wrote:
> From: Zi Yan <ziy@nvidia.com>
> 
> [ upstream commit dd63bd7df41a8f9393a2e3ff9157a441c08eb996  ]
> 
> Fix two inputs to check_anon_huge() and one if condition, so the tests
> work as expected.
> 
> Steps to reproduce the issue.
> make headers
> make -C tools/testing/selftests/vm
> 
> Before patching:test fails with a non-zero exit code
> ~/linux$ sudo tools/testing/selftests/vm/split_huge_page_test | echo 0
> 2
> ~/linux$ sudo tools/testing/selftests/vm/split_huge_page_test
> No THP is allocated
> 
> After patching:
> ~/linux$ sudo tools/testing/selftests/vm/split_huge_page_test | echo 0
> 0
> ~/linux$ sudo tools/testing/selftests/vm/split_huge_page_test
> Split huge pages successful
> ...
> 
> Link: https://lkml.kernel.org/r/20230306160907.16804-1-zi.yan@sent.com
> Fixes: c07c343cda8e ("selftests/vm: dedup THP helpers")
> Cc: stable@vger.kernel.org
> Signed-off-by: Zi Yan <ziy@nvidia.com>
> Reviewed-by: Zach O'Keefe <zokeefe@google.com>
> Tested-by: Zach O'Keefe <zokeefe@google.com>
> Acked-by: David Hildenbrand <david@redhat.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: wndgwang4 <guangming.wang@windriver.com>

We need a real name for a signed-off-by line, you all know this :(

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-29 11:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-28  8:54 [PATCH 6.1.y] selftests/vm: fix split huge page tests wndgwang4
2025-05-29 11:39 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox