mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-28 18:14:23 +00:00
Revert "printk: lock/unlock console only for new logbuf entries"
This reverts commit 3ac37a93fa
.
This optimization will not apply once the transition to a lockless
printk is complete. Rather than porting this optimization through
the transition only to remove it anyway, just revert it now to
simplify the transition.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20200709132344.760-4-john.ogness@linutronix.de
This commit is contained in:
parent
b6cf8b3f33
commit
8749efc0c0
1 changed files with 3 additions and 7 deletions
|
@ -1981,9 +1981,8 @@ asmlinkage int vprintk_emit(int facility, int level,
|
||||||
const char *fmt, va_list args)
|
const char *fmt, va_list args)
|
||||||
{
|
{
|
||||||
int printed_len;
|
int printed_len;
|
||||||
bool in_sched = false, pending_output;
|
bool in_sched = false;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
u64 curr_log_seq;
|
|
||||||
|
|
||||||
/* Suppress unimportant messages after panic happens */
|
/* Suppress unimportant messages after panic happens */
|
||||||
if (unlikely(suppress_printk))
|
if (unlikely(suppress_printk))
|
||||||
|
@ -1999,13 +1998,11 @@ asmlinkage int vprintk_emit(int facility, int level,
|
||||||
|
|
||||||
/* This stops the holder of console_sem just where we want him */
|
/* This stops the holder of console_sem just where we want him */
|
||||||
logbuf_lock_irqsave(flags);
|
logbuf_lock_irqsave(flags);
|
||||||
curr_log_seq = log_next_seq;
|
|
||||||
printed_len = vprintk_store(facility, level, dict, dictlen, fmt, args);
|
printed_len = vprintk_store(facility, level, dict, dictlen, fmt, args);
|
||||||
pending_output = (curr_log_seq != log_next_seq);
|
|
||||||
logbuf_unlock_irqrestore(flags);
|
logbuf_unlock_irqrestore(flags);
|
||||||
|
|
||||||
/* If called from the scheduler, we can not call up(). */
|
/* If called from the scheduler, we can not call up(). */
|
||||||
if (!in_sched && pending_output) {
|
if (!in_sched) {
|
||||||
/*
|
/*
|
||||||
* Disable preemption to avoid being preempted while holding
|
* Disable preemption to avoid being preempted while holding
|
||||||
* console_sem which would prevent anyone from printing to
|
* console_sem which would prevent anyone from printing to
|
||||||
|
@ -2022,8 +2019,7 @@ asmlinkage int vprintk_emit(int facility, int level,
|
||||||
preempt_enable();
|
preempt_enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pending_output)
|
wake_up_klogd();
|
||||||
wake_up_klogd();
|
|
||||||
return printed_len;
|
return printed_len;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(vprintk_emit);
|
EXPORT_SYMBOL(vprintk_emit);
|
||||||
|
|
Loading…
Add table
Reference in a new issue