]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
selftests/mm: fix split_huge_page_test for folio_split() tests
authorZi Yan <ziy@nvidia.com>
Wed, 9 Jul 2025 01:27:59 +0000 (21:27 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 20 Jul 2025 02:26:16 +0000 (19:26 -0700)
PID_FMT does not have an offset field, so folio_split() tests are not
performed.  Add PID_FMT_OFFSET with an offset field and use it to perform
folio_split() tests.

Link: https://lkml.kernel.org/r/20250709012800.3225727-1-ziy@nvidia.com
Fixes: 80a5c494c89f ("selftests/mm: add tests for folio_split(), buddy allocator like split")
Signed-off-by: Zi Yan <ziy@nvidia.com>
Tested-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Donet Tom <donettom@linux.ibm.com>
Tested-by : Donet Tom <donettom@linux.ibm.com>
Cc: Barry Song <baohua@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Mariano Pache <npache@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/split_huge_page_test.c

index aa7400ed0e99468cd6a047e8ab29cbb8bd100419..f0d9c035641dc9369db8cef3a0a7ba93863b98f8 100644 (file)
@@ -31,6 +31,7 @@ uint64_t pmd_pagesize;
 #define INPUT_MAX 80
 
 #define PID_FMT "%d,0x%lx,0x%lx,%d"
+#define PID_FMT_OFFSET "%d,0x%lx,0x%lx,%d,%d"
 #define PATH_FMT "%s,0x%lx,0x%lx,%d"
 
 #define PFN_MASK     ((1UL<<55)-1)
@@ -483,7 +484,7 @@ void split_thp_in_pagecache_to_order_at(size_t fd_size, const char *fs_loc,
                write_debugfs(PID_FMT, getpid(), (uint64_t)addr,
                              (uint64_t)addr + fd_size, order);
        else
-               write_debugfs(PID_FMT, getpid(), (uint64_t)addr,
+               write_debugfs(PID_FMT_OFFSET, getpid(), (uint64_t)addr,
                              (uint64_t)addr + fd_size, order, offset);
 
        for (i = 0; i < fd_size; i++)