linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] tmpfs: zero post-eof ranges on file extension
@ 2025-11-12 16:25 Brian Foster
  2025-11-12 16:25 ` [PATCH v2 1/3] tmpfs: zero post-eof uptodate folios on swapout Brian Foster
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Brian Foster @ 2025-11-12 16:25 UTC (permalink / raw)
  To: linux-mm; +Cc: Hugh Dickins, Baolin Wang

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



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-11-20 14:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-12 16:25 [PATCH v2 0/3] tmpfs: zero post-eof ranges on file extension Brian Foster
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox