Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Zi Yan <ziy@nvidia.com>
To: Vineet Agarwal <agarwal.vineet2006@gmail.com>
Cc: akpm@linux-foundation.org, david@kernel.org, ljs@kernel.org,
	shuah@kernel.org, linux-mm@kvack.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5] selftests/mm: khugepaged: initialize file contents via mmap
Date: Wed, 29 Apr 2026 08:59:53 -0400	[thread overview]
Message-ID: <0C88ED48-CD1F-40C8-B4B9-2388405A6734@nvidia.com> (raw)
In-Reply-To: <20260429115816.98824-1-agarwal.vineet2006@gmail.com>

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

  reply	other threads:[~2026-04-29 13:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29 11:58 [PATCH v5] selftests/mm: khugepaged: initialize file contents via mmap Vineet Agarwal
2026-04-29 12:59 ` Zi Yan [this message]
2026-04-29 13:14 ` David Hildenbrand (Arm)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0C88ED48-CD1F-40C8-B4B9-2388405A6734@nvidia.com \
    --to=ziy@nvidia.com \
    --cc=agarwal.vineet2006@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox