• Kent Overstreet's avatar
    bcachefs: Ignore cached data when calculating fragmentation · 0678cbe2
    Kent Overstreet authored
    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: default avatarKent Overstreet <kent.overstreet@gmail.com>
    0678cbe2
buckets.h 7.91 KB