projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
90d1098
)
locking/csd_lock: Use smp_cond_acquire() in csd_lock_wait()
author
Davidlohr Bueso
<dave@stgolabs>
Thu, 10 Mar 2016 01:55:36 +0000
(17:55 -0800)
committer
Ingo Molnar
<
[email protected]
>
Thu, 10 Mar 2016 09:28:35 +0000
(10:28 +0100)
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 <
[email protected]
>
Acked-by: Peter Zijlstra (Intel) <
[email protected]
>
Cc: Linus Torvalds <
[email protected]
>
Cc: Peter Zijlstra <
[email protected]
>
Cc: Thomas Gleixner <
[email protected]
>
Cc:
[email protected]
Link:
http://lkml.kernel.org/r/
[email protected]
Signed-off-by: Ingo Molnar <
[email protected]
>
kernel/smp.c
patch
|
blob
|
history
diff --git
a/kernel/smp.c
b/kernel/smp.c
index 5099db15c5fb283ac7c305d8e82d266a98abf61d..300d29391e07416d73177c752ecca4afee21d3dd 100644
(file)
--- 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)