diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-01-10 19:46:39 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:22 -0400 |
commit | 0678cbe2cbc586c0055de2c04602bf8136bcc3fc (patch) | |
tree | f58be61fb7a365ca74b2cba9e55317275862732c /fs/bcachefs/buckets.h | |
parent | 3763cb9566a65966cd404cf3e0c5f218e5cf5d16 (diff) | |
download | linux-stable-0678cbe2cbc586c0055de2c04602bf8136bcc3fc.tar.gz linux-stable-0678cbe2cbc586c0055de2c04602bf8136bcc3fc.tar.bz2 linux-stable-0678cbe2cbc586c0055de2c04602bf8136bcc3fc.zip |
bcachefs: Ignore cached data when calculating fragmentation
Previously, bucket fragmentation was considered to be bucket size -
total amount of live data, both dirty and cached.
This meant that if a bucket was full but only a small amount of data in
it was dirty - the rest cached, we'd get stuck: copygc wouldn't move the
dirty data out of the bucket and the allocator wouldn't be able to
invalidate and drop the cached data.
This changes fragmentation to exclude cached data, so that copygc will
evacuate these buckets and copygc/the allocator will always be able to
make forward progress.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/buckets.h')
-rw-r--r-- | fs/bcachefs/buckets.h | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/fs/bcachefs/buckets.h b/fs/bcachefs/buckets.h index 4b5376684d2c..483c8b24293f 100644 --- a/fs/bcachefs/buckets.h +++ b/fs/bcachefs/buckets.h @@ -149,11 +149,6 @@ static inline u8 ptr_stale(struct bch_dev *ca, /* bucket gc marks */ -static inline unsigned bucket_sectors_used(struct bucket_mark mark) -{ - return mark.dirty_sectors + mark.cached_sectors; -} - static inline bool is_available_bucket(struct bucket_mark mark) { return !mark.dirty_sectors && !mark.stripe; |