Commit 90d10984 authored by Davidlohr Bueso's avatar Davidlohr Bueso Committed by Ingo Molnar

locking/csd_lock: Explicitly inline csd_lock*() helpers

While the compiler tends to already to it for us (except for
csd_unlock), make it explicit. These helpers mainly deal with
the ->flags, are short-lived  and can be called, for example,
from smp_call_function_many().
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-2-git-send-email-dbueso@suse.deSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 6cbe9e4a
...@@ -105,13 +105,13 @@ void __init call_function_init(void) ...@@ -105,13 +105,13 @@ void __init call_function_init(void)
* previous function call. For multi-cpu calls its even more interesting * previous function call. For multi-cpu calls its even more interesting
* as we'll have to ensure no other cpu is observing our csd. * as we'll have to ensure no other cpu is observing our csd.
*/ */
static 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) while (smp_load_acquire(&csd->flags) & CSD_FLAG_LOCK)
cpu_relax(); cpu_relax();
} }
static void csd_lock(struct call_single_data *csd) static __always_inline void csd_lock(struct call_single_data *csd)
{ {
csd_lock_wait(csd); csd_lock_wait(csd);
csd->flags |= CSD_FLAG_LOCK; csd->flags |= CSD_FLAG_LOCK;
...@@ -124,7 +124,7 @@ static void csd_lock(struct call_single_data *csd) ...@@ -124,7 +124,7 @@ static void csd_lock(struct call_single_data *csd)
smp_wmb(); smp_wmb();
} }
static void csd_unlock(struct call_single_data *csd) static __always_inline void csd_unlock(struct call_single_data *csd)
{ {
WARN_ON(!(csd->flags & CSD_FLAG_LOCK)); WARN_ON(!(csd->flags & CSD_FLAG_LOCK));
......
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