On Sun, Aug 10, 2025 at 07:07:47PM +0530, Donet Tom wrote:
On 8/10/25 1:12 AM, Wei Yang wrote:
Currently it hard codes the number of hugepage to check for check_huge_anon(), but it would be more reasonable to do the check based on a number passed in.
Pass in the hugepage number and do the check based on it.
Signed-off-by: Wei Yang richard.weiyang@gmail.com Cc: Baolin Wang baolin.wang@linux.alibaba.com Cc: Donet Tom donettom@linux.ibm.com Cc: David Hildenbrand david@redhat.com Cc: Dev Jain dev.jain@arm.com Cc: Lorenzo Stoakes lorenzo.stoakes@oracle.com Cc: Zi Yan ziy@nvidia.com
v2:
- use mm-new
- add back nr_hpages which is removed by an early commit
- adjust the change log a little
- drop RB and resend
tools/testing/selftests/mm/split_huge_page_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c index 5ab488fab1cd..63ac82f0b9e0 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -105,12 +105,12 @@ static char *allocate_zero_filled_hugepage(size_t len) return result; } -static void verify_rss_anon_split_huge_page_all_zeroes(char *one_page, size_t len) +static void verify_rss_anon_split_huge_page_all_zeroes(char *one_page, int nr_hpages, size_t len)
We are re-adding this argument because nr_hpages should be the same in both split_pmd_zero_pages and verify_rss_anon_split_huge_page_all_zeroes, correct? I was just wondering — since the value is currently hardcoded in both functions, would it be preferable to pass it as an argument, or keep it hardcoded, What benefit do we gain by re-adding this argument?
Thanks for your comment.
It looks the correct way to do so.