Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1441418 > unrolled thread

[PATCH RT 17/20] locallock: add local_lock_on()

Started bySteven Rostedt <rostedt@goodmis.org>
First post2016-07-12 16:30 +0200
Last post2016-07-12 16:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH RT 17/20] locallock: add local_lock_on() Steven Rostedt <rostedt@goodmis.org> - 2016-07-12 16:30 +0200

#1441418 — [PATCH RT 17/20] locallock: add local_lock_on()

FromSteven Rostedt <rostedt@goodmis.org>
Date2016-07-12 16:30 +0200
Subject[PATCH RT 17/20] locallock: add local_lock_on()
Message-ID<rU6Rd-66R-57@gated-at.bofh.it>
4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/linux/locallock.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/locallock.h b/include/linux/locallock.h
index 339ba00adb9a..0edbf192f6d1 100644
--- a/include/linux/locallock.h
+++ b/include/linux/locallock.h
@@ -66,6 +66,9 @@ static inline void __local_lock(struct local_irq_lock *lv)
 #define local_lock(lvar)					\
 	do { __local_lock(&get_local_var(lvar)); } while (0)
 
+#define local_lock_on(lvar, cpu)				\
+	do { __local_lock(&per_cpu(lvar, cpu)); } while (0)
+
 static inline int __local_trylock(struct local_irq_lock *lv)
 {
 	if (lv->owner != current && spin_trylock_local(&lv->lock)) {
@@ -104,6 +107,9 @@ static inline void __local_unlock(struct local_irq_lock *lv)
 		put_local_var(lvar);				\
 	} while (0)
 
+#define local_unlock_on(lvar, cpu)                       \
+	do { __local_unlock(&per_cpu(lvar, cpu)); } while (0)
+
 static inline void __local_lock_irq(struct local_irq_lock *lv)
 {
 	spin_lock_irqsave(&lv->lock, lv->flags);
-- 
2.8.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web