Skip to content

rebalance + reflink improvements

Kent Overstreet linux-bcachefs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12bcachefs: Don't keep tons of cached pointers aroundfs/bcachefs/data_update.c fs/bcachefs/data_update.h fs/bcachefs/extents.c +2 more+89 -280 replies
2/12bcachefs: use bch2_data_update_opts_to_text() in trace_move_extent_fail()fs/bcachefs/data_update.c+14 -190 replies
3/12bcachefs: bch2_io_opts_fixups()fs/bcachefs/data_update.c fs/bcachefs/extents.c fs/bcachefs/inode.c +3 more+21 -100 replies
4/12bcachefs: small cleanup for extent ptr bitmasksfs/bcachefs/data_update.c fs/bcachefs/extents.c fs/bcachefs/io_read.c+24 -240 replies
5/12bcachefs: kill bch2_bkey_needs_rebalance()fs/bcachefs/extents.c fs/bcachefs/extents.h+0 -180 replies
6/12bcachefs: kill __bch2_bkey_sectors_need_rebalance()fs/bcachefs/extents.c+10 -130 replies
7/12bcachefs: rename bch_extent_rebalance fields to match other opts structsfs/bcachefs/extents.c fs/bcachefs/extents_format.h fs/bcachefs/rebalance.c+28 -280 replies
8/12bcachefs: io_opts_to_rebalance_opts()fs/bcachefs/data_update.c fs/bcachefs/extents.c fs/bcachefs/extents.h +5 more+39 -500 replies
9/12bcachefs: Add bch_io_opts fields for indicating whether the opts came from the inodefs/bcachefs/inode.c fs/bcachefs/opts.h+10 -10 replies
10/12bcachefs: New bch_extent_rebalance fieldsfs/bcachefs/extents.c fs/bcachefs/extents.h fs/bcachefs/extents_format.h +4 more+138 -730 replies
11/12bcachefs: bch2_indirect_extent_error()fs/bcachefs/io_read.c fs/bcachefs/reflink.c fs/bcachefs/reflink.h+22 -180 replies
12/12bcachefs: bch2_write_inode() now checks for changing rebalance optionsfs/bcachefs/fs.c fs/bcachefs/inode.h fs/bcachefs/rebalance.c +2 more+32 -140 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/12] rebalance + reflink improvements

Reed Riley found an interesting bug where too many cached replicas were being kept around in extents, and the data update path barfed when it hit the limit.

Fixing this meant adding some sort of policy for when we keep a cached copy around (answer: we now keep one, if a promote target is set and it's on the promote target).

But for that to work properly, the data update path needs to know what the promote target is...

This series plumbs the full set of io path options that apply to rebalance through bch_extent_rebalance (i.e. they're kept with the extent when needed, meaning they're available for indirect extents), regularizes and cleans up a fair amount of stuff, and makes it possible for new options to take effect over the options in bch_extent_rebalance, in the extent (we now track whether the option came from the inode or the filesystem, so inode options can correctly take precedence).

data_replicas and data_checksum are now plumbed through bch_extent_rebalance, as well.

Things that did not make the cut:

- Setting new options on a file doesn't yet apply them to indirect extents. I wrote the code for this, but it's a security hole without knowing if this was "your" reflinked data, or copied from another user. Handling this will probably require bch_reflink_p_v2.

- Rebalance doesn't yet apply new data_replicas settings in the background, like it does for the compression and target options (this would remove the need to manually run 'bcachefs rereplicate'.

This one will be easier to do, but I think I want to do some cleanup on data_opts next.

The first patch in the series will go to Linus shortly, the rest next merge window.

Kent Overstreet (12):
bcachefs: Don't keep tons of cached pointers around
bcachefs: use bch2_data_update_opts_to_text() in
trace_move_extent_fail()
bcachefs: bch2_io_opts_fixups()
bcachefs: small cleanup for extent ptr bitmasks
bcachefs: kill bch2_bkey_needs_rebalance()
bcachefs: kill __bch2_bkey_sectors_need_rebalance()
bcachefs: rename bch_extent_rebalance fields to match other opts
structs
bcachefs: io_opts_to_rebalance_opts()
bcachefs: Add bch_io_opts fields for indicating whether the opts came
from the inode
bcachefs: New bch_extent_rebalance fields
bcachefs: bch2_indirect_extent_error()
bcachefs: bch2_write_inode() now checks for changing rebalance options

 fs/bcachefs/data_update.c    |  88 +++++++-------
 fs/bcachefs/data_update.h    |   3 +-
 fs/bcachefs/extents.c        | 223 +++++++++++++++++++----------------
 fs/bcachefs/extents.h        |  13 +-
 fs/bcachefs/extents_format.h |  45 ++++++-
 fs/bcachefs/fs.c             |  26 +++-
 fs/bcachefs/inode.c          |  12 +-
 fs/bcachefs/inode.h          |   8 ++
 fs/bcachefs/io_misc.c        |   2 +-
 fs/bcachefs/io_read.c        |  31 ++---
 fs/bcachefs/io_write.c       |   2 +-
 fs/bcachefs/move.c           |  90 ++++++++++----
 fs/bcachefs/move.h           |   5 +-
 fs/bcachefs/opts.c           |   5 +-
 fs/bcachefs/opts.h           |  29 ++++-
 fs/bcachefs/rebalance.c      |  48 +++-----
 fs/bcachefs/rebalance.h      |   1 +
 fs/bcachefs/reflink.c        |  15 ++-
 fs/bcachefs/reflink.h        |   2 +
 fs/bcachefs/xattr.c          |   7 --
 20 files changed, 393 insertions(+), 262 deletions(-)
Signature · 1 line
2.45.2