From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: 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>,
"Waiman Long" <longman@redhat.com>
Subject: Re: [PATCH 1/3] selftests/futex: Adapt the private hash test to RCU related changes
Date: Tue, 8 Jul 2025 10:01:40 +0200 [thread overview]
Message-ID: <20250708080140.YUpDy-bM@linutronix.de> (raw)
In-Reply-To: <20250708074124.GE1613376@noisy.programming.kicks-ass.net>
On 2025-07-08 09:41:24 [+0200], Peter Zijlstra wrote:
> On Mon, Jul 07, 2025 at 04:36:21PM +0200, Sebastian Andrzej Siewior wrote:
> > The auto scaling on create creation used to automatically assign the new
> > hash because there was the private hash was unused and could be replaced
> > right away.
> >
> > With the upcoming change to wait for a RCU grace period before the hash
> > can be assigned, the test will always fail.
> >
> > If the reported number of hash buckets is not updated after an
> > auto scaling event, block on an acquired lock with a timeout. The timeout
> > is the delay to wait towards a grace period and locking and a locked
> > pthread_mutex_t ensure that glibc calls into kernel using futex
> > operation which will assign new private hash if available.
> > This will retry every 100ms up to 2 seconds in total.
>
> So the auto scaling thing is 'broken' in that if you do a 'final'
> pthread_create() it will try and stage this new hash. If for whatever
> reason the refcount isn't '0' -- and this can already happen today due
> to a concurrent futex operation. Nothing will re-try the rehash.
Sure it was there but not in the way the test case was setup. I *think*
it is okay because in real life the new hash will be put to use unless
you terminate shortly after at which point you don't need it.
> This RCU business made this all but a certainty, but the race was there.
>
> I briefly wondered if we should have a workqueue re-try the rehash.
I don't think we need to worry about it.
Sebastian
next prev parent reply other threads:[~2025-07-08 8:01 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 [this message]
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
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=20250708080140.YUpDy-bM@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=andrealmeid@igalia.com \
--cc=dave@stgolabs.net \
--cc=dvhart@infradead.org \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--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®