Skip to content

Commit

Permalink
lockref: Relax in cmpxchg loop
Browse files Browse the repository at this point in the history
While we are likley to succeed and break out of this loop, it isn't
guaranteed.  We should be power and thread friendly if we do have to
go around for a second (or third, or more) attempt.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
aegl authored and torvalds committed Sep 3, 2013
1 parent 2f01ea9 commit d472d9d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/lockref.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
if (likely(old.lock_count == prev.lock_count)) { \
SUCCESS; \
} \
cpu_relax(); \
} \
} while (0)

Expand Down

0 comments on commit d472d9d

Please sign in to comment.