linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pratyush Yadav <pratyush@kernel.org>
To: Mike Rapoport <rppt@kernel.org>
Cc: Pratyush Yadav <pratyush@kernel.org>,
	 Pasha Tatashin <pasha.tatashin@soleen.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,  linux-mm@kvack.org,
	stable@vger.kernel.org
Subject: Re: [PATCH 1/2] mm: memfd_luo: always make all folios uptodate
Date: Thu, 05 Mar 2026 09:50:18 +0100	[thread overview]
Message-ID: <2vxzqzpybqyd.fsf@kernel.org> (raw)
In-Reply-To: <aZ64ikDtz8tF_rFU@kernel.org> (Mike Rapoport's message of "Wed, 25 Feb 2026 10:53:30 +0200")

On Wed, Feb 25 2026, Mike Rapoport wrote:

> On Mon, Feb 23, 2026 at 06:39:28PM +0100, Pratyush Yadav wrote:
[...]
>> +
>> +		/*
>> +		 * If the folio is not uptodate, it was fallocated but never
>> +		 * used. Saving this flag at prepare() doesn't work since it
>> +		 * might change later when someone uses the folio.
>> +		 *
>> +		 * Since we have taken the performance penalty of allocating,
>> +		 * zeroing, and pinning all the folios in the holes, take a bit
>> +		 * more and zero all non-uptodate folios too.
>> +		 *
>> +		 * NOTE: For someone looking to improve preserve performance,
>> +		 * this is a good place to look.
>
> I'd add a larger comment above memfd_luo_preserve_folios() that says that
> it allocates, pins etc and fold the last two paragraphs of this comment
> there.

How about this:

	/*
	 * If the folio is not uptodate, it was fallocated but never
	 * used. Saving this flag at prepare() doesn't work since it
	 * might change later when the folio is used. Make it uptodate
	 * now to avoid this problem.
	 */
	if (!folio_test_uptodate(folio)) {

And the comment above memfd_pin_folios() gets this:

	 * NOTE: For someone looking to improve preserve performance, this is a
	 * good place to look. Also look at the folio zeroing below.

[...]

-- 
Regards,
Pratyush Yadav


  reply	other threads:[~2026-03-05  8:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23 17:39 [PATCH 0/2] mm: memfd_luo: fixes for folio flag preservation Pratyush Yadav
2026-02-23 17:39 ` [PATCH 1/2] mm: memfd_luo: always make all folios uptodate Pratyush Yadav
2026-02-25  8:53   ` Mike Rapoport
2026-03-05  8:50     ` Pratyush Yadav [this message]
2026-02-23 17:39 ` [PATCH 2/2] mm: memfd_luo: always dirty all folios Pratyush Yadav
2026-02-25  8:58   ` Mike Rapoport
2026-03-05  8:44     ` Pratyush Yadav
2026-03-05 10:40       ` Mike Rapoport

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=2vxzqzpybqyd.fsf@kernel.org \
    --to=pratyush@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=rppt@kernel.org \
    --cc=stable@vger.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