[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250708190605.GF477119@noisy.programming.kicks-ass.net>
Date: Tue, 8 Jul 2025 21:06:05 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: 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 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.
Powered by blists - more mailing lists