Commit 4198bf03 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: Fix lock thrashing in __bchfs_fallocate()



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>
parent f6e6f42b
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment