Skip to content

Commit 19298f4

Browse files
ubizjakKAGA-KOKO
authored andcommitted
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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: André Almeida <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 823a566 commit 19298f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/futex/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ static u64 get_inode_sequence_number(struct inode *inode)
181181
return old;
182182

183183
for (;;) {
184-
u64 new = atomic64_add_return(1, &i_seq);
184+
u64 new = atomic64_inc_return(&i_seq);
185185
if (WARN_ON_ONCE(!new))
186186
continue;
187187

0 commit comments

Comments
 (0)