aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/spinlock_types.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2021-08-15 23:29:27 +0200
committerIngo Molnar <mingo@kernel.org>2021-08-17 19:06:13 +0200
commit31552385f8e9d0869117014bf8e55ba0497e3ec8 (patch)
tree2aac2ec3e333bc60166b13f039923d981f584d70 /include/linux/spinlock_types.h
parentlocking/rtmutex: Add adaptive spinwait mechanism (diff)
downloadlinux-dev-31552385f8e9d0869117014bf8e55ba0497e3ec8.tar.xz
linux-dev-31552385f8e9d0869117014bf8e55ba0497e3ec8.zip
locking/spinlock/rt: Prepare for RT local_lock
Add the static and runtime initializer mechanics to support the RT variant of local_lock, which requires the lock type in the lockdep map to be set to LD_LOCK_PERCPU. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20210815211305.967526724@linutronix.de
Diffstat (limited to 'include/linux/spinlock_types.h')
-rw-r--r--include/linux/spinlock_types.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h
index 8a9aadbaf293..2dfa35ffec76 100644
--- a/include/linux/spinlock_types.h
+++ b/include/linux/spinlock_types.h
@@ -60,6 +60,12 @@ typedef struct spinlock {
SPIN_DEP_MAP_INIT(name) \
}
+#define __LOCAL_SPIN_LOCK_UNLOCKED(name) \
+ { \
+ .lock = __RT_MUTEX_BASE_INITIALIZER(name.lock), \
+ LOCAL_SPIN_DEP_MAP_INIT(name) \
+ }
+
#define DEFINE_SPINLOCK(name) \
spinlock_t name = __SPIN_LOCK_UNLOCKED(name)