• Kent Overstreet's avatar
    bcachefs: Fix lock thrashing in __bchfs_fallocate() · 4198bf03
    Kent Overstreet authored
    We've observed significant lock thrashing on fstests generic/083 in
    fallocate, due to dropping and retaking btree locks when checking the
    pagecache for data.
    
    This adds a nonblocking mode to bch2_clamp_data_hole(), where we only
    use folio_trylock(), and can thus be used safely while btree locks are
    held - thus we only have to drop btree locks as a fallback, on actual
    lock contention.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    4198bf03
fs-io.c 96.3 KB