]> www.infradead.org Git - users/jedix/linux-maple.git/commit
fs/buffer: split locking for pagecache lookups
authorDavidlohr Bueso <dave@stgolabs.net>
Fri, 18 Apr 2025 01:59:15 +0000 (18:59 -0700)
committerChristian Brauner <brauner@kernel.org>
Tue, 22 Apr 2025 16:16:07 +0000 (18:16 +0200)
commit7ffe3de53a885dbb5836541c2178bd07d1bad7df
tree266f9fa38a0cf7def70cd5e8bc3b1c6d4cef9f38
parent559a0d7bf1a6e5a5d0ad4ab4b0089145042e3109
fs/buffer: split locking for pagecache lookups

Callers of __find_get_block() may or may not allow for blocking
semantics, and is currently assumed that it will not. Layout
two paths based on this. The the private_lock scheme will
continued to be used for atomic contexts. Otherwise take the
folio lock instead, which protects the buffers, such as
vs migration and try_to_free_buffers().

Per the "hack idea", the latter can alleviate contention on
the private_lock for bdev mappings. For reasons of determinism
and avoid making bugs hard to reproduce, the trylocking is not
attempted.

No change in semantics. All lookup users still take the spinlock.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Link: https://kdevops.org/ext4/v6.15-rc2.html
Link: https://lore.kernel.org/all/aAAEvcrmREWa1SKF@bombadil.infradead.org/
Link: https://lore.kernel.org/20250418015921.132400-2-dave@stgolabs.net
Tested-by: kdevops@lists.linux.dev
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/buffer.c