Commit d472d9d9 authored by Luck, Tony's avatar Luck, Tony Committed by Linus Torvalds

lockref: Relax in cmpxchg loop

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: default avatarTony Luck <tony.luck@intel.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2f01ea90
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
if (likely(old.lock_count == prev.lock_count)) { \ if (likely(old.lock_count == prev.lock_count)) { \
SUCCESS; \ SUCCESS; \
} \ } \
cpu_relax(); \
} \ } \
} while (0) } while (0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment