Kent Overstreet fb3f57bb11 bcachefs: rebalance_work
This adds a new btree, rebalance_work, to eliminate scanning required
for finding extents that need work done on them in the background - i.e.
for the background_target and background_compression options.

rebalance_work is a bitset btree, where a KEY_TYPE_set corresponds to an
extent in the extents or reflink btree at the same pos.

A new extent field is added, bch_extent_rebalance, which indicates that
this extent has work that needs to be done in the background - and which
options to use. This allows per-inode options to be propagated to
indirect extents - at least in some circumstances. In this patch,
changing IO options on a file will not propagate the new options to
indirect extents pointed to by that file.

Updating (setting/clearing) the rebalance_work btree is done by the
extent trigger, which looks at the bch_extent_rebalance field.

Scanning is still requrired after changing IO path options - either just
for a given inode, or for the whole filesystem. We indicate that
scanning is required by adding a KEY_TYPE_cookie key to the
rebalance_work btree: the cookie counter is so that we can detect that
scanning is still required when an option has been flipped mid-way
through an existing scan.

Future possible work:
 - Propagate options to indirect extents when being changed
 - Add other IO path options - nr_replicas, ec, to rebalance_work so
   they can be applied in the background when they change
 - Add a counter, for bcachefs fs usage output, showing the pending
   amount of rebalance work: we'll probably want to do this after the
   disk space accounting rewrite (moving it to a new btree)

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-01 21:11:05 -04:00
..
2023-10-30 09:47:13 -10:00
2023-10-30 09:47:13 -10:00
2023-10-30 09:47:13 -10:00
2023-11-01 21:11:05 -04:00
2023-10-30 10:42:06 -10:00
2023-10-30 10:23:42 -10:00
2023-10-30 09:47:13 -10:00
2023-10-30 09:47:13 -10:00
2023-10-30 09:47:13 -10:00
2023-10-30 10:23:42 -10:00
2023-10-30 10:23:42 -10:00
2023-10-30 09:47:13 -10:00
2023-10-30 09:47:13 -10:00
2023-10-30 09:47:13 -10:00
2023-10-30 09:47:13 -10:00
2023-09-17 10:33:53 -07:00
2023-10-30 09:47:13 -10:00
2023-10-30 09:47:13 -10:00
2023-10-30 09:47:13 -10:00
2023-10-30 10:12:29 -10:00
2023-10-30 10:12:29 -10:00
2023-08-31 12:07:34 -05:00
2023-10-30 09:14:19 -10:00
2023-10-30 09:47:13 -10:00
2023-10-30 09:47:13 -10:00
2023-10-30 09:47:13 -10:00
2023-10-30 09:47:13 -10:00
2023-10-30 09:47:13 -10:00
2023-10-06 11:01:23 +02:00
2023-10-30 09:47:13 -10:00
2023-10-30 09:47:13 -10:00
2023-10-30 09:47:13 -10:00
2023-10-30 09:47:13 -10:00
2023-06-15 13:37:53 +02:00
2023-10-30 10:23:42 -10:00
2023-10-30 09:47:13 -10:00
2023-06-28 20:35:21 -07:00
2023-06-26 09:50:21 -07:00
2023-05-17 09:16:59 +02:00
2023-08-24 16:20:30 -07:00
2023-09-11 23:59:47 -04:00
2023-07-26 14:56:07 +02:00
2023-08-21 13:46:25 -07:00
2023-10-30 09:14:19 -10:00
2023-10-19 11:02:47 +02:00
2023-10-30 09:47:13 -10:00
2023-08-28 11:04:18 -07:00
2023-10-22 17:08:07 -04:00
2023-08-19 12:12:12 +02:00
2023-10-22 17:08:07 -04:00
2023-01-19 09:24:30 +01:00
2023-10-30 09:14:19 -10:00
2023-10-30 09:47:13 -10:00
2023-05-19 04:30:22 +02:00
2023-05-19 04:30:22 +02:00
2023-08-15 08:32:45 +02:00
2023-02-20 11:53:11 -08:00