linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Regression in generic/749 with 8k fsblock size on 6.18-rc1
@ 2025-10-14 17:52 Darrick J. Wong
  2025-10-15  7:39 ` Kirill A. Shutemov
  2025-10-15 15:59 ` Kiryl Shutsemau
  0 siblings, 2 replies; 12+ messages in thread
From: Darrick J. Wong @ 2025-10-14 17:52 UTC (permalink / raw)
  To: kirill, akpm; +Cc: linux-mm, linux-fsdevel, xfs, Matthew Wilcox

Hi there,

On 6.18-rc1, generic/749[1] running on XFS with an 8k fsblock size fails
with the following:

--- /run/fstests/bin/tests/generic/749.out	2025-07-15 14:45:15.170416031 -0700
+++ /var/tmp/fstests/generic/749.out.bad	2025-10-13 17:48:53.079872054 -0700
@@ -1,2 +1,10 @@
 QA output created by 749
+Expected SIGBUS when mmap() reading beyond page boundary
+Expected SIGBUS when mmap() writing beyond page boundary
+Expected SIGBUS when mmap() reading beyond page boundary
+Expected SIGBUS when mmap() writing beyond page boundary
+Expected SIGBUS when mmap() reading beyond page boundary
+Expected SIGBUS when mmap() writing beyond page boundary
+Expected SIGBUS when mmap() reading beyond page boundary
+Expected SIGBUS when mmap() writing beyond page boundary
 Silence is golden

This test creates small files of various sizes, maps the EOF block, and
checks that you can read and write to the mmap'd page up to (but not
beyond) the next page boundary.

For 8k fsblock filesystems on x86, the pagecache creates a single 8k
folio to cache the entire fsblock containing EOF.  If EOF is in the
first 4096 bytes of that 8k fsblock, then it should be possible to do a
mmap read/write of the first 4k, but not the second 4k.  Memory accesses
to the second 4096 bytes should produce a SIGBUS.

I think the changes introduced in the two patches:

 * mm/fault: Try to map the entire file folio in finish_fault()
 * mm/filemap: Map entire large folio faultaround

break that SIGBUS behavior by mapping the entire 8k folio into the
process.

Reverting thes two patches on an 6.18-rc1 kernel makes the regression go
away, but only by clumsily reverting to the 6.17 behavior where the
pagecache touched each base page of a large folio instead of doing
something to the whole folio at once.  I don't know what would be a good
solution, since you only need to do page-at-a-time for the EOF page, but
there's not really a good way to coordinate with i_size updates.

Did your testing also demonstrate this regression?

--D

[1] https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/tree/tests/generic/749?h=for-next

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

end of thread, other threads:[~2025-10-21 17:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-14 17:52 Regression in generic/749 with 8k fsblock size on 6.18-rc1 Darrick J. Wong
2025-10-15  7:39 ` Kirill A. Shutemov
2025-10-15 17:45   ` Darrick J. Wong
2025-10-15 15:59 ` Kiryl Shutsemau
2025-10-15 17:57   ` Darrick J. Wong
2025-10-16 10:22     ` Kiryl Shutsemau
2025-10-16 22:33       ` Dave Chinner
2025-10-17 14:28         ` Kiryl Shutsemau
2025-10-17 16:02           ` Darrick J. Wong
2025-10-17 17:00             ` Kiryl Shutsemau
2025-10-17 17:14           ` Matthew Wilcox
2025-10-21 17:02         ` Luis Chamberlain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).