[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <103a68e9-9627-42ad-ae86-3b023c3230d7@redhat.com>
Date: Thu, 10 Jul 2025 11:58:50 -0400
From: Waiman Long <llong@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: Waiman Long <llong@...hat.com>, linux-kernel@...r.kernel.org,
Andr?? Almeida <andrealmeid@...lia.com>, Darren Hart <dvhart@...radead.org>,
Davidlohr Bueso <dave@...olabs.net>, Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>, Thomas Gleixner <tglx@...utronix.de>,
Valentin Schneider <vschneid@...hat.com>
Subject: Re: [PATCH 2/3] futex: Use RCU-based per-CPU reference counting
instead of rcuref_t
On 7/8/25 3:06 PM, Peter Zijlstra wrote:
> On Tue, Jul 08, 2025 at 03:47:08PM +0200, Sebastian Andrzej Siewior wrote:
>> On 2025-07-08 09:43:44 [-0400], Waiman Long wrote:
>>> This looks somewhat like what the percpu refcount does (see
>>> lib/percpu-refcount.c). Could this be used instead of reinventing the wheel
>>> again?
>> From the comment:
>>
>> * futex-ref
>> *
>> * Heavily inspired by percpu-rwsem/percpu-refcount; not reusing any of that
>> * code because it just doesn't fit right.
>> *
>> * Dual counter, per-cpu / atomic approach like percpu-refcount, except it
>> * re-initializes the state automatically, such that the fph swizzle is also a
>> * transition back to per-cpu.
>>
>> but I leave it up to Peter if he considers merging that.
> Basically what the comment says. Trying to reuse things ended up in a
> mess. It really isn't much code, most of it is comments.
>
I got it now. I am not against adding a variant specific to this code
giving that we want to fix the performance regression ASAP. Merging it
to any existing set of helpers may be something we want to do in the future.
Cheers,
Longman
Powered by blists - more mailing lists