On Tue, May 27, 2025 at 06:17:07PM +0200, Greg Kroah-Hartman wrote:
6.14-stable review patch. If anyone has any objections, please let me know.
From: Davidlohr Bueso dave@stgolabs.net
[ Upstream commit 7ffe3de53a885dbb5836541c2178bd07d1bad7df ]
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.
As noted to Sasha before, one of these changes apply to stable kernels, since buffer-heads lacked folio min order support until v6.15. So these patches from Davidlohr are not fixing anything on older kernels.
Luis