From: Davidlohr Bueso Date: Thu, 10 Mar 2016 01:55:36 +0000 (-0800) Subject: locking/csd_lock: Use smp_cond_acquire() in csd_lock_wait() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=38460a2178d225b39ade5ac66586c3733391cf86;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: Davidlohr Bueso Acked-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: dave@stgolabs.net Link: http://lkml.kernel.org/r/1457574936-19065-3-git-send-email-dbueso@suse.de Signed-off-by: Ingo Molnar --- diff --git a/kernel/smp.c b/kernel/smp.c index 5099db15c5fb..300d29391e07 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -107,8 +107,7 @@ void __init call_function_init(void) */ static __always_inline void csd_lock_wait(struct call_single_data *csd) { - while (smp_load_acquire(&csd->flags) & CSD_FLAG_LOCK) - cpu_relax(); + smp_cond_acquire(!(csd->flags & CSD_FLAG_LOCK)); } static __always_inline void csd_lock(struct call_single_data *csd)