linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: linux-mm@kvack.org
Cc: Hugh Dickins <hughd@google.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>
Subject: [PATCH v2 0/3] tmpfs: zero post-eof ranges on file extension
Date: Wed, 12 Nov 2025 11:25:19 -0500	[thread overview]
Message-ID: <20251112162522.412295-1-bfoster@redhat.com> (raw)

Hi all,

First and foremost, I'm posting this v2 with a bit of a caveat. This had
survived most of my testing until I rebased onto -next and came up with
a bit more involved of an fsx test that concurrently stresses swap
activity. I root caused a couple or so issues that fell out of that
which appeared to be preexisting problems, then ultimately ran into the
folio_next_pos() type issue that exists in for-next (this causes wrong
same_folio values and subsequently wonky behavior).

So with that I need to reset my thinking and revisit that particular
test, but given that I hadn't thus far changed anything in these
patches, I wanted to get a v2 of the core work out on the list. Note
that this is based on -next and I'm testing locally with the
folio_next_pos() changes reverted (including the call added in patch 3).

With that out of the way, I think this addresses the open issues from
the discussion on v1. The main difference in v2 is that rather than just
zero the post-eof portion of the EOF folio, we now zero the full range
between the current and new i_size to accommodate situations where large
folios may split across writeout and swap in.

Patch 1 introduces post-eof zeroing at writeout time so the zeroing call
can skip swap entries. Patch 2 is an incremental cleanup (I found it
easier to split the change this way, but these two patches could be
squashed). Patch 3 introduces the zeroing behavior.

Thoughts, reviews, flames appreciated.

Brian

v2:
- Rework to zero uptodate post-eof folios on writeout and full range
  from EOF on size extension.
- Misc. cleanups: variable renames (pos -> end), code relocation,
  comment cleanups/removal.
- Update commit log to call out POSIX requirement.
v1: https://lore.kernel.org/linux-mm/20250625184930.269727-1-bfoster@redhat.com/

Brian Foster (3):
  tmpfs: zero post-eof uptodate folios on swapout
  tmpfs: combine !uptodate and post-eof zeroing logic at swapout
  tmpfs: zero post-eof ranges on file extension

 mm/shmem.c | 135 ++++++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 113 insertions(+), 22 deletions(-)

-- 
2.51.1



             reply	other threads:[~2025-11-12 16:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-12 16:25 Brian Foster [this message]
2025-11-12 16:25 ` [PATCH v2 1/3] tmpfs: zero post-eof uptodate folios on swapout Brian Foster
2025-11-18  2:33   ` Baolin Wang
2025-11-18 14:39     ` Brian Foster
2025-11-19  3:53       ` Baolin Wang
2025-11-19 14:08         ` Brian Foster
2025-11-20  1:57           ` Baolin Wang
2025-11-20 14:12             ` Brian Foster
2025-11-12 16:25 ` [PATCH v2 2/3] tmpfs: combine !uptodate and post-eof zeroing logic at swapout Brian Foster
2025-11-20  2:56   ` Baolin Wang
2025-11-20 14:14     ` Brian Foster
2025-11-12 16:25 ` [PATCH v2 3/3] tmpfs: zero post-eof ranges on file extension Brian Foster
2025-11-20  5:57   ` Baolin Wang
2025-11-20 14:21     ` Brian Foster

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=20251112162522.412295-1-bfoster@redhat.com \
    --to=bfoster@redhat.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.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