Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

futex: Use atomic64_inc_return() in get_inode_sequence_number()

Use atomic64_inc_return(&ref) instead of atomic64_add_return(1, &ref)
to use optimized implementation and ease register pressure around
the primitive for targets that implement optimized variant.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: André Almeida <andrealmeid@igalia.com>
Link: https://lore.kernel.org/all/20241010071023.21913-1-ubizjak@gmail.com

authored by

Uros Bizjak and committed by
Thomas Gleixner
19298f48 823a5662

+1 -1
+1 -1
kernel/futex/core.c
··· 181 181 return old; 182 182 183 183 for (;;) { 184 - u64 new = atomic64_add_return(1, &i_seq); 184 + u64 new = atomic64_inc_return(&i_seq); 185 185 if (WARN_ON_ONCE(!new)) 186 186 continue; 187 187