提交 855cf1ee 编写于 作者: L Linus Torvalds

Merge tag 'locking-urgent-2020-11-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking fix from Thomas Gleixner:
 "A single fix for lockdep which makes the recursion protection cover
  graph lock/unlock"

* tag 'locking-urgent-2020-11-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  lockdep: Put graph lock/unlock under lock_recursion protection
...@@ -108,19 +108,21 @@ static inline void lockdep_lock(void) ...@@ -108,19 +108,21 @@ static inline void lockdep_lock(void)
{ {
DEBUG_LOCKS_WARN_ON(!irqs_disabled()); DEBUG_LOCKS_WARN_ON(!irqs_disabled());
__this_cpu_inc(lockdep_recursion);
arch_spin_lock(&__lock); arch_spin_lock(&__lock);
__owner = current; __owner = current;
__this_cpu_inc(lockdep_recursion);
} }
static inline void lockdep_unlock(void) static inline void lockdep_unlock(void)
{ {
DEBUG_LOCKS_WARN_ON(!irqs_disabled());
if (debug_locks && DEBUG_LOCKS_WARN_ON(__owner != current)) if (debug_locks && DEBUG_LOCKS_WARN_ON(__owner != current))
return; return;
__this_cpu_dec(lockdep_recursion);
__owner = NULL; __owner = NULL;
arch_spin_unlock(&__lock); arch_spin_unlock(&__lock);
__this_cpu_dec(lockdep_recursion);
} }
static inline bool lockdep_assert_locked(void) static inline bool lockdep_assert_locked(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册