Skip to content

btrfs: remove COW fixup and checked folio flag

Qu Wenruo linux-btrfs 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyIn review
  2. v22 patches 1 replySuperseded
  3. v12 patches 3 repliesSuperseded

Changes in v3 from the cover letter

- 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.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: remove the COW fixup mechanismfs/btrfs/Kconfig fs/btrfs/btrfs_inode.h fs/btrfs/disk-io.c +3 more+10 -2430 replies
2/2btrfs: remove folio checked subpage bitmap trackingfs/btrfs/defrag.c fs/btrfs/file.c fs/btrfs/free-space-cache.c +4 more+4 -610 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDavid Sterba
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] btrfs: remove COW fixup and checked folio flag

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(-)
Signature · 1 line
2.53.0