Re: [PATCH v5] selftests/mm: khugepaged: initialize file contents via mmap
From: David Hildenbrand (Arm)
Date: Wed Apr 29 2026 - 09:21:42 EST
On 4/29/26 13:58, Vineet Agarwal wrote:
> 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.
>
> Signed-off-by: Vineet Agarwal <agarwal.vineet2006@xxxxxxxxx>
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
Thanks! :)
--
Cheers,
David