Commit 0f4b5f97 authored by peterz@infradead.org's avatar peterz@infradead.org Committed by Peter Zijlstra
Browse files

futex: Add sys_futex_requeue()



Finish off the 'simple' futex2 syscall group by adding
sys_futex_requeue(). Unlike sys_futex_{wait,wake}() its arguments are
too numerous to fit into a regular syscall. As such, use struct
futex_waitv to pass the 'source' and 'destination' futexes to the
syscall.

This syscall implements what was previously known as FUTEX_CMP_REQUEUE
and uses {val, uaddr, flags} for source and {uaddr, flags} for
destination.

This design explicitly allows requeueing between different types of
futex by having a different flags word per uaddr.

Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/20230921105248.511860556@noisy.programming.kicks-ass.net
parent 27b88f35
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -494,3 +494,4 @@
562	common	fchmodat2			sys_fchmodat2
563	common	futex_wake			sys_futex_wake
564	common	futex_wait			sys_futex_wait
565	common	futex_requeue			sys_futex_requeue
+1 −0
Original line number Diff line number Diff line
@@ -468,3 +468,4 @@
452	common	fchmodat2			sys_fchmodat2
454	common	futex_wake			sys_futex_wake
455	common	futex_wait			sys_futex_wait
456	common	futex_requeue			sys_futex_requeue
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@
#define __ARM_NR_compat_set_tls		(__ARM_NR_COMPAT_BASE + 5)
#define __ARM_NR_COMPAT_END		(__ARM_NR_COMPAT_BASE + 0x800)

#define __NR_compat_syscalls		456
#define __NR_compat_syscalls		457
#endif

#define __ARCH_WANT_SYS_CLONE
+2 −0
Original line number Diff line number Diff line
@@ -915,6 +915,8 @@ __SYSCALL(__NR_fchmodat2, sys_fchmodat2)
__SYSCALL(__NR_futex_wake, sys_futex_wake)
#define __NR_futex_wait 455
__SYSCALL(__NR_futex_wait, sys_futex_wait)
#define __NR_futex_requeue 456
__SYSCALL(__NR_futex_requeue, sys_futex_requeue)

/*
 * Please add new compat syscalls above this comment and update
+1 −0
Original line number Diff line number Diff line
@@ -375,3 +375,4 @@
452	common	fchmodat2			sys_fchmodat2
454	common	futex_wake			sys_futex_wake
455	common	futex_wait			sys_futex_wait
456	common	futex_requeue			sys_futex_requeue
Loading