Skip to content

Commit

Permalink
Merge branch 'core-printk-for-linus' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/tip/tip

* 'core-printk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  printk, lockdep: Switch to tracked irq ops
  printk, lockdep: Remove superfluous preempt_disable()
  printk, lockdep: Disable lock debugging on zap_locks()
  • Loading branch information
Linus Torvalds committed Jan 6, 2012
2 parents 4a2164a + 1a9a8ae commit 1483b38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions include/linux/lockdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_recursing(tsk) ((tsk)->lockdep_recursion)

#else /* !LOCKDEP */

static inline void lockdep_off(void)
Expand Down Expand Up @@ -392,6 +394,8 @@ struct lock_class_key { };

#define lockdep_assert_held(l) do { } while (0)

#define lockdep_recursing(tsk) (0)

#endif /* !LOCKDEP */

#ifdef CONFIG_LOCK_STAT
Expand Down
9 changes: 4 additions & 5 deletions kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ static void zap_locks(void)

oops_timestamp = jiffies;

debug_locks_off();
/* If a crash is occurring, make sure we can't deadlock */
raw_spin_lock_init(&logbuf_lock);
/* And make sure that we print immediately */
Expand Down Expand Up @@ -840,9 +841,8 @@ asmlinkage int vprintk(const char *fmt, va_list args)
boot_delay_msec();
printk_delay();

preempt_disable();
/* This stops the holder of console_sem just where we want him */
raw_local_irq_save(flags);
local_irq_save(flags);
this_cpu = smp_processor_id();

/*
Expand All @@ -856,7 +856,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)
* recursion and return - but flag the recursion so that
* it can be printed at the next appropriate moment:
*/
if (!oops_in_progress) {
if (!oops_in_progress && !lockdep_recursing(current)) {
recursion_bug = 1;
goto out_restore_irqs;
}
Expand Down Expand Up @@ -962,9 +962,8 @@ asmlinkage int vprintk(const char *fmt, va_list args)

lockdep_on();
out_restore_irqs:
raw_local_irq_restore(flags);
local_irq_restore(flags);

preempt_enable();
return printed_len;
}
EXPORT_SYMBOL(printk);
Expand Down

0 comments on commit 1483b38

Please sign in to comment.