提交 94d24fc4 编写于 作者: P Peter Zijlstra 提交者: Ingo Molnar

printk, lockdep: Disable lock debugging on zap_locks()

zap_locks() is used by printk() in a last ditch effort to get data
out, clearly we cannot trust lock state after this so make it disable
lock debugging.

Also don't treat printk recursion through lockdep as a normal
recursion bug but try hard to get the lockdep splat out.
Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-kqxwmo4xz37e1s8w0xopvr0q@git.kernel.orgSigned-off-by: NIngo Molnar <mingo@elte.hu>
上级 7f80850d
...@@ -343,6 +343,8 @@ extern void lockdep_trace_alloc(gfp_t mask); ...@@ -343,6 +343,8 @@ extern void lockdep_trace_alloc(gfp_t mask);
#define lockdep_assert_held(l) WARN_ON(debug_locks && !lockdep_is_held(l)) #define lockdep_assert_held(l) WARN_ON(debug_locks && !lockdep_is_held(l))
#define lockdep_recursing(tsk) ((tsk)->lockdep_recursion)
#else /* !LOCKDEP */ #else /* !LOCKDEP */
static inline void lockdep_off(void) static inline void lockdep_off(void)
...@@ -392,6 +394,8 @@ struct lock_class_key { }; ...@@ -392,6 +394,8 @@ struct lock_class_key { };
#define lockdep_assert_held(l) do { } while (0) #define lockdep_assert_held(l) do { } while (0)
#define lockdep_recursing(tsk) (0)
#endif /* !LOCKDEP */ #endif /* !LOCKDEP */
#ifdef CONFIG_LOCK_STAT #ifdef CONFIG_LOCK_STAT
......
...@@ -688,6 +688,7 @@ static void zap_locks(void) ...@@ -688,6 +688,7 @@ static void zap_locks(void)
oops_timestamp = jiffies; oops_timestamp = jiffies;
debug_locks_off();
/* If a crash is occurring, make sure we can't deadlock */ /* If a crash is occurring, make sure we can't deadlock */
raw_spin_lock_init(&logbuf_lock); raw_spin_lock_init(&logbuf_lock);
/* And make sure that we print immediately */ /* And make sure that we print immediately */
...@@ -856,7 +857,7 @@ asmlinkage int vprintk(const char *fmt, va_list args) ...@@ -856,7 +857,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)
* recursion and return - but flag the recursion so that * recursion and return - but flag the recursion so that
* it can be printed at the next appropriate moment: * it can be printed at the next appropriate moment:
*/ */
if (!oops_in_progress) { if (!oops_in_progress && !lockdep_recursing(current)) {
recursion_bug = 1; recursion_bug = 1;
goto out_restore_irqs; goto out_restore_irqs;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册