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

K Prateek Nayak
2025-09-09T09:52:39Z

Hello Thomas,

On 9/9/2025 4:30 AM, Thomas Gleixner wrote:
> --- a/kernel/rseq.c
> +++ b/kernel/rseq.c
> @@ -542,6 +542,15 @@ int rseq_slice_extension_prctl(unsigned
> return -EFAULT;
> }
>
> +SYSCALL_DEFINE0(rseq_slice_yield)
> +{
> + if (need_resched()) {
> + schedule();
> + return 1;
> + }
> + return 0;
> +}
> +
> static int __init rseq_slice_cmdline(char *str)
> {
> bool on;
> --- a/kernel/sys_ni.c
> +++ b/kernel/sys_ni.c
> @@ -390,5 +390,6 @@ COND_SYSCALL(setuid16);
>
> /* restartable sequence */
> COND_SYSCALL(rseq);
> +COND_SYSCALL(rseq_sched_yield);

I'm not sure if it is my toolchain but when I try to build a version
with CONFIG_RSEQ_SLICE_EXTENSION disabled, I see:

ld: vmlinux.o: in function `x64_sys_call':
arch/x86/include/generated/asm/syscalls_64.h:471: undefined reference to `__x64_sys_rseq_slice_yield'
ld: vmlinux.o: in function `ia32_sys_call':
arch/x86/include/generated/asm/syscalls_32.h:471: undefined reference to `__ia32_sys_rseq_slice_yield'
ld: vmlinux.o:(.rodata+0x12d0): undefined reference to `__x64_sys_rseq_slice_yield'

I would have assumed the COND_SYSCALL() above would have stubbed this
but that doesn't seem to be the case. Am I missing something?
P.S. I'm running with:

gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04.2)
GNU ld (GNU Binutils for Ubuntu) 2.38

--
Thanks and Regards,
Prateek