From: David Laight <david.laight.linux@gmail.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Mark Rutland <mark.rutland@arm.com>,
cmarinas@kernel.org, maddy@linux.ibm.com, hca@linux.ibm.com,
ryan.roberts@arm.com
Subject: Re: [RFC] in-kernel rseq
Date: Tue, 24 Feb 2026 14:49:50 +0000 [thread overview]
Message-ID: <20260224144950.38f6a632@pumpkin> (raw)
In-Reply-To: <f25c1f92-4170-4197-b2c0-2b77c731877f@efficios.com>
On Tue, 24 Feb 2026 08:33:23 -0500
Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:
> On 2026-02-24 05:27, David Laight wrote:
> [...]
> >
> > No scaling, in this case it is fine to add the rseq just before needing it.
>
> In all cases it is fine to set the per-task rseq pointer just before
> needing it. That's how the userspace rseq was implemented.
>
> > But if they have to be set in advance then you start getting a long list
> > to check - I'm sure that must happen with userspace rseq?
>
> No, userspace declares rseq_cs descriptors in its data, and populates
> the rseq_abi->rseq_cs field (thread-local) with a pointer to that
> descriptor at the very beginning of the critical section.
>
> So return to userspace after context switch either finds a NULL pointer
> or only needs to load from a single rseq_cs descriptor from userspace.
So all of the program has to use a single (per thread) 'rseq' structure?
And you better not try to use it in a signal handler.
I'm sure I should know the main use-case for user-space rseq.
I do remember a big problem with short-duration 'hot mutex' used for
(eg) removing work items from a linked list.
Although the 'hold time' is usually only a few instructions (so contention
is unlikely) if you get hit by an ethernet interrupt while the mutex is
held it can take milliseconds for all the softint code to complete before
the mutex is released - not good for system throughput.
David
>
> Thanks,
>
> Mathieu
>
next prev parent reply other threads:[~2026-02-24 14:49 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 16:38 [RFC] in-kernel rseq Peter Zijlstra
2026-02-23 17:53 ` David Laight
2026-02-23 18:22 ` Mathieu Desnoyers
2026-02-23 21:54 ` Peter Zijlstra
2026-02-24 10:27 ` David Laight
2026-02-24 13:33 ` Mathieu Desnoyers
2026-02-24 14:49 ` David Laight [this message]
2026-02-24 16:15 ` Mathieu Desnoyers
2026-02-24 11:16 ` Heiko Carstens
2026-02-24 13:48 ` Mathieu Desnoyers
2026-02-24 14:59 ` David Laight
2026-02-24 16:18 ` Mathieu Desnoyers
2026-02-24 15:17 ` Peter Zijlstra
2026-02-24 15:20 ` Peter Zijlstra
2026-02-24 16:02 ` Heiko Carstens
2026-02-24 16:15 ` Heiko Carstens
2026-04-10 17:57 ` Shrikanth Hegde
2026-04-15 8:51 ` Heiko Carstens
2026-04-17 9:29 ` Shrikanth Hegde
2026-04-17 9:36 ` Shrikanth Hegde
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=20260224144950.38f6a632@pumpkin \
--to=david.laight.linux@gmail.com \
--cc=cmarinas@kernel.org \
--cc=hca@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maddy@linux.ibm.com \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=peterz@infradead.org \
--cc=ryan.roberts@arm.com \
--cc=tglx@linutronix.de \
/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