selftests-mm-khugepaged-initialize-file-contents-via-mmap.patch removed from -mm tree
The quilt patch titled
Subject: selftests/mm: khugepaged: initialize file contents via mmap
has been removed from the -mm tree. Its filename was
selftests-mm-khugepaged-initialize-file-contents-via-mmap.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Vineet Agarwal <[email protected]>
Subject: selftests/mm: khugepaged: initialize file contents via mmap
Date: Wed, 29 Apr 2026 17:28:16 +0530
file_setup_area() currently allocates anonymous memory, fills it, and writes it into the backing file used for collapse testing.
Instead of copying data through write(), resize the file with ftruncate(), map it directly with MAP_SHARED, and initialize the mapped area in place.
This simplifies the setup path and avoids the need for explicit partial write handling.
---
tools/testing/selftests/mm/khugepaged.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
tools/testing/selftests/mm/khugepaged.c renamed from tools/testing/selftests/mm/khugepaged.c~selftests-mm-khugepaged-initialize-file-contents-via-mmap +15 -3
@@ -373,7 +373,7 @@ static void *file_setup_area(int nr_hpagunlink (finfo.path);/* Cleanup from previous failed tests */ printf ("Creating %s for collapse%s..." , finfo.path, finfo.type ==VMA_SHMEM ?" (tmpfs)" :"" ); - fd =open (finfo.path,O_DSYNC |O_CREAT |O_RDWR |O_TRUNC |O_EXCL , + fd =open (finfo.path,O_CREAT |O_RDWR |O_TRUNC |O_EXCL ,777 );if (fd <0 ) {perror ("open()" );
@@ -381,9 +381,21 @@ static void *file_setup_area(int nr_hpag } size = nr_hpages * hpage_pmd_size; - p =alloc_mapping (nr_hpages); +if (ftruncate (fd, size)) { +perror ("ftruncate()" ); +exit (EXIT_FAILURE ); + } + p =mmap (BASE_ADDR , size,PROT_READ |PROT_WRITE , +MAP_SHARED , fd,0 ); +if (p !=BASE_ADDR ) { +perror ("mmap()" ); +exit (EXIT_FAILURE ); + }fill_memory (p,0 , size); -write (fd, p, size); +if (msync (p, size,MS_SYNC )) { +perror ("msync()" ); +exit (EXIT_FAILURE ); + }close (fd);munmap (p, size);success ("OK" );
_
Patches currently in -mm which might be from [email protected] are
selftests-mm-check-file-initialization-writes-in-split_huge_page_test.patch mm-damon-sysfs-schemes-fix-double-increment-of-nr_regions.patch selftests-mm-ksm-functional-tests-fix-partial-write-handling.patch