Re: [patch V4 06/12] rseq: Implement sys_rseq_slice_yield()

From: Arnd Bergmann
Date: Sun Nov 16 2025 - 16:53:19 EST


On Sun, Nov 16, 2025, at 21:51, Thomas Gleixner wrote:
> Provide a new syscall which has the only purpose to yield the CPU after the
> kernel granted a time slice extension.
>
> sched_yield() is not suitable for that because it unconditionally
> schedules, but the end of the time slice extension is not required to
> schedule when the task was already preempted. This also allows to have a
> strict check for termination to catch user space invoking random syscalls
> including sched_yield() from a time slice extension region.
>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Arnd Bergmann <arnd@xxxxxxxx>
> Cc: linux-arch@xxxxxxxxxxxxxxx
> ---
> V2: Use the proper name in sys_ni.c and add comment - Prateek

I checked that the syscalls are well-formed across
all architectures, which is easy here, since there
are no arguments.

Acked-by: Arnd Bergmann <arnd@xxxxxxxx>

Two minor comments:

- Number 470 is also used in Christian Brauner's listns
series. Obviously only one of you can claim that number.

> +++ b/arch/mips/kernel/syscalls/syscall_n32.tbl
> @@ -408,3 +408,4 @@
> 467 n32 open_tree_attr sys_open_tree_attr
> 468 n32 file_getattr sys_file_getattr
> 469 n32 file_setattr sys_file_setattr
> +470 common rseq_slice_yield sys_rseq_slice_yield
> --- a/arch/mips/kernel/syscalls/syscall_n64.tbl
> +++ b/arch/mips/kernel/syscalls/syscall_n64.tbl
> @@ -384,3 +384,4 @@
> 467 n64 open_tree_attr sys_open_tree_attr
> 468 n64 file_getattr sys_file_getattr
> 469 n64 file_setattr sys_file_setattr
> +470 common rseq_slice_yield sys_rseq_slice_yield
> --- a/arch/mips/kernel/syscalls/syscall_o32.tbl
> +++ b/arch/mips/kernel/syscalls/syscall_o32.tbl
> @@ -457,3 +457,4 @@
> 467 o32 open_tree_attr sys_open_tree_attr
> 468 o32 file_getattr sys_file_getattr
> 469 o32 file_setattr sys_file_setattr
> +470 common rseq_slice_yield sys_rseq_slice_yield

- These should probably all become 'common' eventually, especially
now that the s390 compat syscalls are out of the way, I would like
to revisit my series that unifies the tables for syscalls over
402 into a single source file. Until then, it's probably less
confusing to keep the format and use n32/n64/o32 here.

Arnd