Commit 38460a21 authored by Davidlohr Bueso's avatar Davidlohr Bueso Committed by Ingo Molnar

locking/csd_lock: Use smp_cond_acquire() in csd_lock_wait()

We can micro-optimize this call and mildly relax the
barrier requirements by relying on ctrl + rmb, keeping
the acquire semantics. In addition, this is pretty much
the now standard for busy-waiting under such restraints.
Signed-off-by: default avatarDavidlohr Bueso <dbueso@suse.de>
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: dave@stgolabs.net
Link: http://lkml.kernel.org/r/1457574936-19065-3-git-send-email-dbueso@suse.deSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 90d10984
...@@ -107,8 +107,7 @@ void __init call_function_init(void) ...@@ -107,8 +107,7 @@ void __init call_function_init(void)
*/ */
static __always_inline void csd_lock_wait(struct call_single_data *csd) static __always_inline void csd_lock_wait(struct call_single_data *csd)
{ {
while (smp_load_acquire(&csd->flags) & CSD_FLAG_LOCK) smp_cond_acquire(!(csd->flags & CSD_FLAG_LOCK));
cpu_relax();
} }
static __always_inline void csd_lock(struct call_single_data *csd) static __always_inline void csd_lock(struct call_single_data *csd)
......
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