summaryrefslogtreecommitdiff
path: root/fs/bcachefs/buckets.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-01-11 03:46:39 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:22 +0300
commit0678cbe2cbc586c0055de2c04602bf8136bcc3fc (patch)
treef58be61fb7a365ca74b2cba9e55317275862732c /fs/bcachefs/buckets.h
parent3763cb9566a65966cd404cf3e0c5f218e5cf5d16 (diff)
downloadlinux-0678cbe2cbc586c0055de2c04602bf8136bcc3fc.tar.xz
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.h5
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;