• Kent Overstreet's avatar
    bcachefs: New bucket invalidate path · caece7fe
    Kent Overstreet authored
    In the old allocator code, preparing an existing empty bucket was part
    of the same code path that invalidated buckets containing cached data.
    In the new allocator code this is no longer the case: the main allocator
    path finds empty buckets (via the new freespace btree), and can't
    allocate buckets that contain cached data.
    
    We now need a separate code path to invalidate buckets containing cached
    data when we're low on empty buckets, which this patch implements. When
    the number of free buckets decreases that triggers the new invalidate
    path to run, which uses the LRU btree to pick cached data buckets to
    invalidate until we're above our watermark.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    caece7fe
alloc_background.h 3.91 KB