[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <68bafe10-23db-4885-b4d7-7d8126da76d7@efficios.com>
Date: Fri, 31 Oct 2025 15:43:41 -0400
From: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To: Thomas Gleixner <tglx@...utronix.de>, LKML <linux-kernel@...r.kernel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
"Paul E. McKenney" <paulmck@...nel.org>, Boqun Feng <boqun.feng@...il.com>,
Jonathan Corbet <corbet@....net>,
Prakash Sangappa <prakash.sangappa@...cle.com>,
Madadi Vineeth Reddy <vineethr@...ux.ibm.com>,
K Prateek Nayak <kprateek.nayak@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Arnd Bergmann <arnd@...db.de>, linux-arch@...r.kernel.org
Subject: Re: [patch V3 05/12] rseq: Add prctl() to enable time slice
extensions
On 2025-10-29 09:22, Thomas Gleixner wrote:
> Implement a prctl() so that tasks can enable the time slice extension
> mechanism. This fails, when time slice extensions are disabled at compile
> time or on the kernel command line and when no rseq pointer is registered
> in the kernel.
I'm still unsure that going for enabling per-thread vs per-process is
the right approach. Enabling per-thread requires to either modify each
thread's startup code, or integrate this into libc's thread startup.
Enabling per-process makes it easy to invoke from program or library
constructor.
[...]
>
> +int rseq_slice_extension_prctl(unsigned long arg2, unsigned long arg3)
> +{
[...]
> + case PR_RSEQ_SLICE_EXTENSION_SET: {
> + u32 rflags, valid = RSEQ_CS_FLAG_SLICE_EXT_AVAILABLE;
> + bool enable = !!(arg3 & PR_RSEQ_SLICE_EXT_ENABLE);
> +
> + if (arg3 & ~PR_RSEQ_SLICE_EXT_ENABLE)
> + return -EINVAL;
> + if (!rseq_slice_extension_enabled())
> + return -ENOTSUPP;
> + if (!current->rseq.usrptr)
> + return -ENXIO;
> +
So what happens if we have an (unlikely) scenario of:
- thread startup
- thread registration to rseq
- prctl PR_RSEQ_SLICE_EXTENSION_SET
- rseq unregistration
- rseq registration
--> What's the status of slice extension here ?
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
Powered by blists - more mailing lists