mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <llong@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Waiman Long <llong@redhat.com>,
	linux-kernel@vger.kernel.org,
	Andr?? Almeida <andrealmeid@igalia.com>,
	Darren Hart <dvhart@infradead.org>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Ingo Molnar <mingo@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Valentin Schneider <vschneid@redhat.com>
Subject: Re: [PATCH 2/3] futex: Use RCU-based per-CPU reference counting instead of rcuref_t
Date: Thu, 10 Jul 2025 11:58:50 -0400	[thread overview]
Message-ID: <103a68e9-9627-42ad-ae86-3b023c3230d7@redhat.com> (raw)
In-Reply-To: <20250708190605.GF477119@noisy.programming.kicks-ass.net>

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


  reply	other threads:[~2025-07-10 15:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-07 14:36 [PATCH 0/3] futex: Use RCU-based per-CPU reference counting Sebastian Andrzej Siewior
2025-07-07 14:36 ` [PATCH 1/3] selftests/futex: Adapt the private hash test to RCU related changes Sebastian Andrzej Siewior
2025-07-08  7:41   ` Peter Zijlstra
2025-07-08  8:01     ` Sebastian Andrzej Siewior
2025-07-10  8:08       ` Sebastian Andrzej Siewior
2025-07-07 14:36 ` [PATCH 2/3] futex: Use RCU-based per-CPU reference counting instead of rcuref_t Sebastian Andrzej Siewior
2025-07-08  6:51   ` Sebastian Andrzej Siewior
2025-07-08  8:56   ` Hillf Danton
2025-07-08  9:16     ` Sebastian Andrzej Siewior
2025-07-08 12:01       ` Hillf Danton
2025-07-08 13:15         ` Sebastian Andrzej Siewior
2025-07-08 22:00           ` Hillf Danton
2025-07-08 13:09   ` Sebastian Andrzej Siewior
2025-07-08 13:43   ` Waiman Long
2025-07-08 13:47     ` Sebastian Andrzej Siewior
2025-07-08 19:06       ` Peter Zijlstra
2025-07-10 15:58         ` Waiman Long [this message]
2025-07-07 14:36 ` [PATCH 3/3] futex: Make futex_private_hash_get() static Sebastian Andrzej Siewior
2025-07-08  7:50 ` [PATCH 0/3] futex: Use RCU-based per-CPU reference counting Peter Zijlstra
2025-07-08  8:02   ` Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=103a68e9-9627-42ad-ae86-3b023c3230d7@redhat.com \
    --to=llong@redhat.com \
    --cc=andrealmeid@igalia.com \
    --cc=bigeasy@linutronix.de \
    --cc=dave@stgolabs.net \
    --cc=dvhart@infradead.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®