summaryrefslogtreecommitdiff
path: root/kernel/futex
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2024-10-10 09:10:04 +0200
committerThomas Gleixner <tglx@linutronix.de>2024-10-17 22:02:27 +0200
commit19298f48694987fac843261c84e24834c255b451 (patch)
tree70ef0c4279e9687a6b3fd4e45f39d7ee08df99cb /kernel/futex
parent823a566221a5639f6c69424897218e5d6431a970 (diff)
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
Diffstat (limited to 'kernel/futex')
-rw-r--r--kernel/futex/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/futex/core.c b/kernel/futex/core.c
index 136768ae2637..3146730e55f7 100644
--- a/kernel/futex/core.c
+++ b/kernel/futex/core.c
@@ -181,7 +181,7 @@ static u64 get_inode_sequence_number(struct inode *inode)
return old;
for (;;) {
- u64 new = atomic64_add_return(1, &i_seq);
+ u64 new = atomic64_inc_return(&i_seq);
if (WARN_ON_ONCE(!new))
continue;