Re: [PATCH v2 2/2] mm: implement page refcount locking via dedicated bit
From: David Hildenbrand (Arm)
Date: Thu Apr 23 2026 - 15:24:18 EST
On 4/23/26 20:24, Matthew Wilcox wrote:
> On Mon, Apr 20, 2026 at 08:01:19AM +0000, Gorbunov Ivan wrote:
>> The current atomic-based page refcount implementation treats zero
>> counter as dead and requires a compare-and-swap loop in folio_try_get()
>> to prevent incrementing a dead refcount. This CAS loop acts as a
>> serialization point and can become a significant bottleneck during
>> high-frequency file read operations.
>
> If the file read is high-frequency, then for the page refcount to be
> the bottleneck, they must be small reads? Have you looked at this
> patch?
>
> https://lore.kernel.org/all/20251017141536.577466-1-kirill@xxxxxxxxxxxxx/
I hate that with passion. It reminds me of load_unaligned_zeropad(). Which I
hate with passion.
(somewhere on my todo list is investigating hot to get rid of that whole
load_unaligned_zeropad machinery)
--
Cheers,
David