Messages in this thread |  | | From | Zi Yan <> | | Subject | Re: [PATCH v5] selftests/mm: khugepaged: initialize file contents via mmap | | Date | Wed, 29 Apr 2026 08:59:53 -0400 |
| |
On 29 Apr 2026, at 7: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@gmail.com> > > v4 -> v5: > - Restore msync() to keep folios clean for READ_ONLY_THP_FOR_FS > - Remove O_DSYNC since msync() handles synchronization > - Simplify mmap() check and drop unnecessary cleanup in error paths > --- > tools/testing/selftests/mm/khugepaged.c | 18 +++++++++++++++--- > 1 file changed, 15 insertions(+), 3 deletions(-) > LGTM. And it no longer regresses for READ_ONLY_THP_FOR_FS tests. Thanks.
Reviewed-by: Zi Yan <ziy@nvidia.com> Tested-by: Zi Yan <ziy@nvidia.com>
Best Regards, Yan, Zi
|  |