Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH v3 0/2] btrfs: remove COW fixup and checked folio flag
@ 2026-04-14  3:35 Qu Wenruo
  2026-04-14  3:35 ` [PATCH v3 1/2] btrfs: remove the COW fixup mechanism Qu Wenruo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Qu Wenruo @ 2026-04-14  3:35 UTC (permalink / raw)
  To: linux-btrfs

Changelog:
v3:
- Open-code btrfs_writepage_cow_fixup()
  The function is now only a folio_test_ordered() and error message.
  There is no need to keep it as an dedicated function.

v2:
- Also remove the fixup worker

- Slightly reword the cover letter

- Remove COW fixup related comments

- Update Kconfig to reflect this change.

For experimental builds we're already rejecting dirty folios which
don't have ordered flags since v6.15.

Unfortunately we're not yet removing that COW fixup machanism for
non-experimental builds even at v7.0, as we can still trigger the
warning when we detect dirty folios without ordered extents.

So far all those problems only happen when errors are injected into the
IO path, e.g. generic/475, and I haven't yet seen it triggered without
error handling.

Although I prefer to remove the COW fixup after all error handling
problems are fixed, I run out of ideas how those cases can happen, and
the current handling of treating such cases as write errors is not
going to make things any worse anyway.

Furthermore for the future of huge folios (order 9, 2M page on 4K page
size systems), we can not afford the extra bitmap for a huge folio.
In that case, a huge folio will need 64 bytes per bitmap, which is no
longer a small amount.

I believe it's time to remove the COW fixup mechanism even for
non-experimental builds, along with the checked folio flags.

Qu Wenruo (2):
  btrfs: remove the COW fixup mechanism
  btrfs: remove folio checked subpage bitmap tracking

 fs/btrfs/Kconfig            |   4 -
 fs/btrfs/btrfs_inode.h      |   1 -
 fs/btrfs/defrag.c           |   1 -
 fs/btrfs/disk-io.c          |  16 +--
 fs/btrfs/extent_io.c        |  23 ++--
 fs/btrfs/file.c             |  12 +--
 fs/btrfs/free-space-cache.c |   4 -
 fs/btrfs/fs.h               |   7 --
 fs/btrfs/inode.c            | 205 ------------------------------------
 fs/btrfs/reflink.c          |   1 -
 fs/btrfs/subpage.c          |  39 +------
 fs/btrfs/subpage.h          |   5 +-
 12 files changed, 14 insertions(+), 304 deletions(-)

-- 
2.53.0


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

end of thread, other threads:[~2026-04-14 15:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-14  3:35 [PATCH v3 0/2] btrfs: remove COW fixup and checked folio flag Qu Wenruo
2026-04-14  3:35 ` [PATCH v3 1/2] btrfs: remove the COW fixup mechanism Qu Wenruo
2026-04-14  3:35 ` [PATCH v3 2/2] btrfs: remove folio checked subpage bitmap tracking Qu Wenruo
2026-04-14 15:32 ` [PATCH v3 0/2] btrfs: remove COW fixup and checked folio flag David Sterba

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