]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xfs: don't decrement the buffer LRU count for in-use buffers
authorChristoph Hellwig <hch@lst.de>
Mon, 23 Mar 2026 07:50:54 +0000 (08:50 +0100)
committerCarlos Maiolino <cem@kernel.org>
Mon, 30 Mar 2026 14:34:05 +0000 (16:34 +0200)
commit8166876aadef90744bb26addc9c5a16b1c8341b5
treeb1b91e059b210c654d26753695e986ce19d99b2a
parent497560b9ef42a4ab22ada7f1ea975a89cd3c5dfa
xfs: don't decrement the buffer LRU count for in-use buffers

XFS buffers are added to the LRU when they are unused, but are only
removed from the LRU lazily when the LRU list scan finds a used buffer.
So far this only happen when the LRU counter hits 0, which is suboptimal
as buffers that were added to the LRU, but are in use again still consume
LRU scanning resources and are aged while actually in use.

Fix this by checking for in-use buffers and removing the from the LRU
before decrementing the LRU counter.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_buf.c