diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2021-08-15 23:29:27 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2021-08-17 19:06:13 +0200 |
commit | 31552385f8e9d0869117014bf8e55ba0497e3ec8 (patch) | |
tree | 2aac2ec3e333bc60166b13f039923d981f584d70 /include/linux/spinlock_rt.h | |
parent | 992caf7f17243d736fc996770bac6566103778f6 (diff) | |
download | linux-31552385f8e9d0869117014bf8e55ba0497e3ec8.tar.gz linux-31552385f8e9d0869117014bf8e55ba0497e3ec8.tar.bz2 linux-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_rt.h')
-rw-r--r-- | include/linux/spinlock_rt.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/include/linux/spinlock_rt.h b/include/linux/spinlock_rt.h index 4fc72199cc9d..835aedaf68ac 100644 --- a/include/linux/spinlock_rt.h +++ b/include/linux/spinlock_rt.h @@ -8,20 +8,28 @@ #ifdef CONFIG_DEBUG_LOCK_ALLOC extern void __rt_spin_lock_init(spinlock_t *lock, const char *name, - struct lock_class_key *key); + struct lock_class_key *key, bool percpu); #else static inline void __rt_spin_lock_init(spinlock_t *lock, const char *name, - struct lock_class_key *key) + struct lock_class_key *key, bool percpu) { } #endif -#define spin_lock_init(slock) \ -do { \ - static struct lock_class_key __key; \ - \ - rt_mutex_base_init(&(slock)->lock); \ - __rt_spin_lock_init(slock, #slock, &__key); \ +#define spin_lock_init(slock) \ +do { \ + static struct lock_class_key __key; \ + \ + rt_mutex_base_init(&(slock)->lock); \ + __rt_spin_lock_init(slock, #slock, &__key, false); \ +} while (0) + +#define local_spin_lock_init(slock) \ +do { \ + static struct lock_class_key __key; \ + \ + rt_mutex_base_init(&(slock)->lock); \ + __rt_spin_lock_init(slock, #slock, &__key, true); \ } while (0) extern void rt_spin_lock(spinlock_t *lock); |