2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-06 00:46:55 -04:00
|
|
|
|
2021-12-25 21:21:46 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-15 19:53:46 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2024-07-11 16:30:41 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
2019-12-19 15:07:51 -05:00
|
|
|
|
2024-01-06 21:01:47 -05:00
|
|
|
|
2024-02-24 21:09:51 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2018-11-01 15:13:19 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
2024-04-13 22:43:11 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
2023-03-01 23:10:39 -05:00
|
|
|
|
2022-12-14 20:52:11 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-18 15:43:50 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
2022-09-18 15:43:50 -04:00
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-14 20:30:30 -04:00
|
|
|
|
2023-02-03 21:01:40 -05:00
|
|
|
|
2022-04-14 20:30:30 -04:00
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-18 15:43:50 -04:00
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
2022-09-18 15:43:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
2022-09-18 15:43:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-22 15:59:53 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-03 21:01:40 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
2023-02-03 21:01:40 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-07 18:38:16 -04:00
|
|
|
|
2022-06-13 19:34:17 -04:00
|
|
|
|
2024-04-13 22:43:11 -04:00
|
|
|
|
2024-06-28 21:40:00 -04:00
|
|
|
|
2024-04-20 14:49:22 -04:00
|
|
|
|
|
|
|
|
|
2024-07-11 16:11:45 -04:00
|
|
|
|
2024-10-29 20:53:50 +08:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-26 17:05:02 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 16:11:56 +12:00
|
|
|
|
2023-10-25 16:29:37 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-28 17:08:41 -04:00
|
|
|
|
2021-03-31 21:07:37 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-19 20:13:30 -05:00
|
|
|
|
2020-06-15 19:53:46 -04:00
|
|
|
|
2024-07-11 16:30:41 -04:00
|
|
|
|
2020-07-06 20:18:13 -04:00
|
|
|
|
2021-07-12 23:52:49 -04:00
|
|
|
|
2023-02-28 23:08:48 -05:00
|
|
|
|
2022-10-31 16:13:05 -04:00
|
|
|
|
2022-12-07 18:41:21 +13:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2023-02-09 12:21:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-07-06 22:47:42 -04:00
|
|
|
|
2023-02-09 12:21:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-10 16:08:24 -04:00
|
|
|
|
|
|
|
|
|
2023-02-09 12:21:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2023-05-30 14:41:50 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-23 17:23:41 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2022-03-15 21:36:33 +13:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2024-10-29 20:54:08 +08:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
2021-04-13 14:45:55 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
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-10-20 13:33:14 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2018-11-01 15:13:19 -04:00
|
|
|
|
|
|
|
|
|
2019-12-19 15:07:51 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-03-11 20:38:46 -05:00
|
|
|
|
2021-07-23 13:57:19 -06:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-19 15:33:38 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bcachefs: Rework btree node pinning
In backpointers fsck, we do a seqential scan of one btree, and check
references to another: extents <-> backpointers
Checking references generates random lookups, so we want to pin that
btree in memory (or only a range, if it doesn't fit in ram).
Previously, this was done with a simple check in the shrinker - "if
btree node is in range being pinned, don't free it" - but this generated
OOMs, as our shrinker wasn't well behaved if there was less memory
available than expected.
Instead, we now have two different shrinkers and lru lists; the second
shrinker being for pinned nodes, with seeks set much higher than normal
- so they can still be freed if necessary, but we'll prefer not to.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-09-04 20:49:37 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bcachefs: Rework btree node pinning
In backpointers fsck, we do a seqential scan of one btree, and check
references to another: extents <-> backpointers
Checking references generates random lookups, so we want to pin that
btree in memory (or only a range, if it doesn't fit in ram).
Previously, this was done with a simple check in the shrinker - "if
btree node is in range being pinned, don't free it" - but this generated
OOMs, as our shrinker wasn't well behaved if there was less memory
available than expected.
Instead, we now have two different shrinkers and lru lists; the second
shrinker being for pinned nodes, with seeks set much higher than normal
- so they can still be freed if necessary, but we'll prefer not to.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-09-04 20:49:37 -04:00
|
|
|
|
|
|
|
|
|
2024-01-16 13:29:59 -05:00
|
|
|
|
bcachefs: Rework btree node pinning
In backpointers fsck, we do a seqential scan of one btree, and check
references to another: extents <-> backpointers
Checking references generates random lookups, so we want to pin that
btree in memory (or only a range, if it doesn't fit in ram).
Previously, this was done with a simple check in the shrinker - "if
btree node is in range being pinned, don't free it" - but this generated
OOMs, as our shrinker wasn't well behaved if there was less memory
available than expected.
Instead, we now have two different shrinkers and lru lists; the second
shrinker being for pinned nodes, with seeks set much higher than normal
- so they can still be freed if necessary, but we'll prefer not to.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-09-04 20:49:37 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-25 17:06:11 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2024-02-24 21:09:51 -05:00
|
|
|
|
2023-11-24 23:40:08 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-10 16:08:24 -04:00
|
|
|
|
2023-11-24 23:40:08 -05:00
|
|
|
|
2024-02-24 21:09:51 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-06 21:01:47 -05:00
|
|
|
|
2023-11-24 23:40:08 -05:00
|
|
|
|
|
|
|
|
|
2024-02-24 21:09:51 -05:00
|
|
|
|
2023-11-24 23:40:08 -05:00
|
|
|
|
|
|
|
|
|
2024-02-24 21:09:51 -05:00
|
|
|
|
2023-11-24 23:40:08 -05:00
|
|
|
|
|
|
|
|
|
2024-02-24 21:09:51 -05:00
|
|
|
|
2024-09-05 16:59:29 +00:00
|
|
|
|
2023-11-24 23:40:08 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-25 17:06:11 -04:00
|
|
|
|
2018-11-01 15:13:19 -04:00
|
|
|
|
|
|
|
|
|
2021-05-23 17:04:13 -04:00
|
|
|
|
2021-04-13 15:00:40 -04:00
|
|
|
|
2024-10-09 23:02:04 -04:00
|
|
|
|
|
|
|
|
|
2021-04-13 15:00:40 -04:00
|
|
|
|
2023-02-03 21:01:40 -05:00
|
|
|
|
2021-04-13 15:00:40 -04:00
|
|
|
|
|
|
|
|
|
2024-02-23 17:23:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-26 17:05:02 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2022-10-28 17:08:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
|
|
|
|
|
2021-04-13 15:00:40 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2023-03-01 23:10:39 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
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-10-20 13:33:14 -04:00
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
2022-09-30 16:37:15 +13:00
|
|
|
|
2020-11-19 20:13:30 -05:00
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
|
|
|
|
|
2020-06-15 19:53:46 -04:00
|
|
|
|
2024-07-11 16:30:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
|
|
|
|
|
2020-07-06 20:18:13 -04:00
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
2024-08-06 21:02:34 -04:00
|
|
|
|
2021-07-12 23:52:49 -04:00
|
|
|
|
2023-02-28 23:08:48 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-31 16:13:05 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
|
|
|
|
|
2018-11-01 15:13:19 -04:00
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
|
|
|
|
|
2019-12-19 15:07:51 -05:00
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-03-11 20:38:46 -05:00
|
|
|
|
|
|
|
|
|
2021-07-23 13:57:19 -06:00
|
|
|
|
2023-02-09 12:21:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-12-14 20:52:11 -05:00
|
|
|
|
|
|
|
|
|
2022-12-07 18:41:21 +13:00
|
|
|
|
2023-05-30 14:41:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-16 00:11:33 -04:00
|
|
|
|
2024-05-03 14:49:23 -04:00
|
|
|
|
2024-04-16 00:11:33 -04:00
|
|
|
|
2024-02-23 17:23:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-15 14:58:47 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-26 17:05:02 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-13 22:43:11 -04:00
|
|
|
|
2021-12-24 04:51:10 -05:00
|
|
|
|
|
|
|
|
|
2024-04-20 14:49:22 -04:00
|
|
|
|
bcachefs: Rework btree node pinning
In backpointers fsck, we do a seqential scan of one btree, and check
references to another: extents <-> backpointers
Checking references generates random lookups, so we want to pin that
btree in memory (or only a range, if it doesn't fit in ram).
Previously, this was done with a simple check in the shrinker - "if
btree node is in range being pinned, don't free it" - but this generated
OOMs, as our shrinker wasn't well behaved if there was less memory
available than expected.
Instead, we now have two different shrinkers and lru lists; the second
shrinker being for pinned nodes, with seeks set much higher than normal
- so they can still be freed if necessary, but we'll prefer not to.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-09-04 20:49:37 -04:00
|
|
|
|
2021-12-24 04:51:10 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bcachefs: Rework btree node pinning
In backpointers fsck, we do a seqential scan of one btree, and check
references to another: extents <-> backpointers
Checking references generates random lookups, so we want to pin that
btree in memory (or only a range, if it doesn't fit in ram).
Previously, this was done with a simple check in the shrinker - "if
btree node is in range being pinned, don't free it" - but this generated
OOMs, as our shrinker wasn't well behaved if there was less memory
available than expected.
Instead, we now have two different shrinkers and lru lists; the second
shrinker being for pinned nodes, with seeks set much higher than normal
- so they can still be freed if necessary, but we'll prefer not to.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-09-04 20:49:37 -04:00
|
|
|
|
2021-12-24 04:51:10 -05:00
|
|
|
|
|
|
|
|
|
2024-04-20 14:49:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-05 21:18:57 -04:00
|
|
|
|
2024-04-20 14:49:22 -04:00
|
|
|
|
2022-09-17 15:20:13 -04:00
|
|
|
|
2024-04-06 00:11:01 -04:00
|
|
|
|
2020-06-15 15:10:54 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2022-04-07 18:38:16 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-13 19:34:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-13 22:43:11 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-28 21:40:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-11 16:11:45 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-12-01 12:23:55 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2020-12-01 12:23:55 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
2024-04-13 22:43:11 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-28 17:08:41 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2024-07-31 23:39:49 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-15 21:36:33 +13:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-03 21:01:40 -05:00
|
|
|
|
|
|
|
|
|
2024-11-12 16:15:47 +08:00
|
|
|
|
2022-03-15 21:36:33 +13:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-11-12 16:15:47 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-10 16:08:24 -04:00
|
|
|
|
2024-11-12 16:15:47 +08:00
|
|
|
|
2023-03-30 18:49:02 -04:00
|
|
|
|
2023-02-03 21:01:40 -05:00
|
|
|
|
2022-03-15 21:36:33 +13:00
|
|
|
|
2024-04-10 16:08:24 -04:00
|
|
|
|
2024-11-12 16:15:47 +08:00
|
|
|
|
2023-03-30 18:49:02 -04:00
|
|
|
|
2023-02-03 21:01:40 -05:00
|
|
|
|
2022-03-15 21:36:33 +13:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-22 15:59:53 -04:00
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-22 15:59:53 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-26 17:05:02 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2020-11-19 20:13:30 -05:00
|
|
|
|
2020-06-15 19:53:46 -04:00
|
|
|
|
2024-07-11 16:30:41 -04:00
|
|
|
|
2021-12-14 14:24:04 -05:00
|
|
|
|
2020-07-06 20:18:13 -04:00
|
|
|
|
2021-07-12 23:52:49 -04:00
|
|
|
|
2023-02-28 23:08:48 -05:00
|
|
|
|
2022-10-31 16:13:05 -04:00
|
|
|
|
2023-02-09 12:21:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-12-07 18:41:21 +13:00
|
|
|
|
2021-12-14 14:24:04 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-07 18:38:16 -04:00
|
|
|
|
2022-06-13 19:34:17 -04:00
|
|
|
|
2024-04-13 22:43:11 -04:00
|
|
|
|
2024-06-28 21:40:00 -04:00
|
|
|
|
2024-04-20 14:49:22 -04:00
|
|
|
|
|
|
|
|
|
2024-07-11 16:11:45 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2021-04-13 15:00:40 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2021-04-13 14:45:55 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-03-11 20:38:46 -05:00
|
|
|
|
2021-07-23 13:57:19 -06:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2023-05-30 14:41:50 -04:00
|
|
|
|
|
|
|
|
|
2024-04-16 00:11:33 -04:00
|
|
|
|
2024-02-23 17:23:41 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-05 12:01:16 -05:00
|
|
|
|
2023-02-03 21:01:40 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-06 15:15:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-09 12:21:45 -05:00
|
|
|
|
2022-03-06 15:15:41 -05:00
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2022-03-06 15:15:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2022-03-21 00:15:38 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-06 15:15:41 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2018-11-12 18:30:55 -05:00
|
|
|
|
|
|
|
|
|
2022-03-06 15:15:41 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2024-07-15 19:26:46 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
2024-01-16 16:20:21 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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-10-20 13:33:14 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2024-10-24 01:06:53 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-06 15:15:41 -05:00
|
|
|
|
|
|
|
|
|
2023-02-09 12:21:45 -05:00
|
|
|
|
2022-03-06 15:15:41 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-14 14:24:41 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-25 17:06:11 -04:00
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-19 15:33:38 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-25 16:29:37 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2019-02-06 11:42:13 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
2023-02-03 21:01:40 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2019-02-06 11:42:13 -05:00
|
|
|
|
2023-02-03 21:01:40 -05:00
|
|
|
|
2024-01-06 20:57:43 -05:00
|
|
|
|
2019-02-06 11:42:13 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-22 11:12:14 -04:00
|
|
|
|
|
|
|
|
|
2023-02-03 21:01:40 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-06 20:57:43 -05:00
|
|
|
|
2023-02-03 21:01:40 -05:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
2024-10-29 20:54:08 +08:00
|
|
|
|
2023-02-03 21:01:40 -05:00
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
2023-10-25 16:29:37 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
2024-02-01 12:41:42 -08:00
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
|
|
|
|
|
2024-02-01 12:41:42 -08:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-25 13:18:19 -05:00
|
|
|
|
2024-05-03 14:49:23 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
2024-08-06 21:02:34 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-15 19:26:46 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
2022-05-25 16:11:56 +12:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-15 19:54:51 -04:00
|
|
|
|
2022-05-25 16:11:56 +12:00
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-25 16:29:37 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-29 20:54:08 +08:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-25 16:29:37 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-06 21:02:34 -04:00
|
|
|
|
2017-03-16 22:18:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|