The patch titled Subject: selftests/vm: update hugetlb madvise has been added to the -mm mm-unstable branch. Its filename is selftests-vm-update-hugetlb-madvise.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-vm-update-hugetlb-madvise.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Mike Kravetz <mike.kravetz@xxxxxxxxxx> Subject: selftests/vm: update hugetlb madvise Date: Thu, 3 Nov 2022 18:16:32 -0700 Commit 8ebe0a5eaaeb ("mm,madvise,hugetlb: fix unexpected data loss with MADV_DONTNEED on hugetlbfs") changed how the passed length was interpreted for hugetlb mappings. It was changed from align up to align down. The hugetlb-madvise test explicitly tests this behavior. Change test to expect new behavior. Link: https://lkml.kernel.org/r/20221104011632.357049-1-mike.kravetz@xxxxxxxxxx Link: https://lore.kernel.org/oe-lkp/202211040619.2ec447d7-oliver.sang@xxxxxxxxx Signed-off-by: Mike Kravetz <mike.kravetz@xxxxxxxxxx> Reported-by: kernel test robot <oliver.sang@xxxxxxxxx> Cc: David Hildenbrand <david@xxxxxxxxxx> Cc: Rik van Riel <riel@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- tools/testing/selftests/vm/hugetlb-madvise.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/tools/testing/selftests/vm/hugetlb-madvise.c~selftests-vm-update-hugetlb-madvise +++ a/tools/testing/selftests/vm/hugetlb-madvise.c @@ -195,7 +195,7 @@ int main(int argc, char **argv) exit(1); } - /* addr + length should be aligned up to huge page size */ + /* addr + length should be aligned down to huge page size */ if (madvise(addr, ((NR_HUGE_PAGES - 1) * huge_page_size) + base_page_size, MADV_DONTNEED)) { @@ -203,10 +203,11 @@ int main(int argc, char **argv) exit(1); } - /* should free all pages in mapping */ - validate_free_pages(free_hugepages); + /* should free all but last page in mapping */ + validate_free_pages(free_hugepages - 1); (void)munmap(addr, NR_HUGE_PAGES * huge_page_size); + validate_free_pages(free_hugepages); /* * Test MADV_DONTNEED on anonymous private mapping _ Patches currently in -mm which might be from mike.kravetz@xxxxxxxxxx are hugetlb-dont-delete-vma_lock-in-hugetlb-madv_dontneed-processing.patch hugetlb-simplify-hugetlb-handling-in-follow_page_mask.patch hugetlb-simplify-hugetlb-handling-in-follow_page_mask-v4.patch hugetlb-simplify-hugetlb-handling-in-follow_page_mask-v5.patch selftests-vm-update-hugetlb-madvise.patch