lkml.org 
[lkml]   [2016]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH v8 1/2] printk: Make printk() completely async
On Fri 25-03-16 00:43:22, Sergey Senozhatsky wrote:
> @@ -1655,6 +1670,14 @@ asmlinkage int vprintk_emit(int facility, int level,
> raw_spin_lock(&logbuf_lock);
> logbuf_cpu = this_cpu;
>
> + /*
> + * Set printing kthread sleep condition early, under the
> + * logbuf_lock, so it (if RUNNING) will go to console_lock()
> + * and spin on logbuf_lock.
> + */
> + if (!in_panic && printk_kthread && !need_flush_console)
> + need_flush_console = true;
> +
> if (unlikely(recursion_bug)) {
> static const char recursion_msg[] =
> "BUG: recent printk recursion!";

I like the cleaned up need_flush_console handling! Just a suggestion: It
may be more logical to handle need_flush_console setting under logbuf_lock
but after we actually store the message in the buffer, not before. Doesn't
matter for correctness now but may be more future-proof.

Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR

\
 
 \ /
  Last update: 2016-03-29 12:01    [W:1.982 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site