• Kent Overstreet's avatar
    bcachefs: Avoid write lock on mark_lock · fca1223c
    Kent Overstreet authored
    mark_lock is a frequently taken lock, and there's also potential for
    deadlocks since currently bch2_clear_page_bits which is called from
    memory reclaim has to take it to drop disk reservations.
    
    The disk reservation get path takes it when it recalculates the number
    of sectors known to be available, but it's not really needed for
    consistency.  We just want to make sure we only have one thread updating
    the sectors_available count, which we can do with a dedicated mutex.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    fca1223c
buckets.c 34.8 KB