[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87v8budqdz.ffs@tglx>
Date: Thu, 28 Sep 2023 21:55:20 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org,
"Paul E . McKenney" <paulmck@...nel.org>,
Boqun Feng <boqun.feng@...il.com>,
"H . Peter Anvin" <hpa@...or.com>, Paul Turner <pjt@...gle.com>,
linux-api@...r.kernel.org, Christian Brauner <brauner@...nel.org>,
Florian Weimer <fw@...eb.enyo.de>, David.Laight@...LAB.COM,
carlos@...hat.com, Peter Oskolkov <posk@...k.io>,
Alexander Mikhalitsyn <alexander@...alicyn.com>,
Chris Kennelly <ckennelly@...gle.com>,
Ingo Molnar <mingo@...hat.com>,
Darren Hart <dvhart@...radead.org>,
Davidlohr Bueso <dave@...olabs.net>,
André Almeida
<andrealmeid@...lia.com>, libc-alpha@...rceware.org,
Steven Rostedt <rostedt@...dmis.org>,
Jonathan Corbet <corbet@....net>,
Noah Goldstein <goldstein.w.n@...il.com>,
Daniel Colascione <dancol@...gle.com>, longman@...hat.com,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [RFC PATCH v2 4/4] selftests/rseq: Implement rseq_mutex test
program
On Mon, May 29 2023 at 15:14, Mathieu Desnoyers wrote:
> +static void rseq_lock_slowpath(struct rseq_mutex *lock)
> +{
> + int i = 0;
> +
> + for (;;) {
> + struct rseq_abi_sched_state *expected = NULL, *self = rseq_get_sched_state(rseq_get_abi());
> +
> + if (__atomic_compare_exchange_n(&lock->owner, &expected, self, false,
> + __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
> + break;
> + //TODO: use rseq critical section to protect dereference of owner thread's
> + //rseq_abi_sched_state, combined with rseq fence at thread reclaim.
> + if ((RSEQ_READ_ONCE(expected->state) & RSEQ_ABI_SCHED_STATE_FLAG_ON_CPU) &&
For robust and PI futexes the futex value is an ABI between kernel and
user space. Sure, this is only meant for demonstration, but it's the
wrong direction.
Thanks,
tglx
Powered by blists - more mailing lists