Messages in this thread | | | Date | Fri, 8 Jun 2018 10:39:06 +0200 | From | Petr Mladek <> | Subject | Re: [PATCH v2] printk: make sure to print log on console. |
| |
On Fri 2018-06-01 14:26:42, Maninder Singh wrote: > This patch make sure printing of log on console if loglevel > at time of storing log is less than current console loglevel. > > @why > In SMP printk can work asynchronously, logs can be missed on console > because it checks current log level at time of console_unlock, > not at time of storing logs. > > func() > { > .... > .... > console_verbose(); // user wants to have all the logs on console. > pr_alert(); > dump_backtrace(); //prints with default loglevel. > ... > console_silent(); // stop all logs from printing on console. > } > > Now if console_lock was owned by another process, the messages might > be handled after the consoles were silenced.
It might make sense to document the limitations reported by Sergey. I mean to add something like:
"There are still some corner cases where this patch is not enough, for example, when the messages are flushed later from printk_safe buffers or when there are races between console_verbose() and console_silent() callers."
> reused flag LOG_NOCONS as its usage is gone long back. > (5c2992ee7fd8a29d04125dc0aa3522784c5fa5eb) > > Signed-off-by: Vaneet Narang <v.narang@samsung.com> > Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Anyway. the patch helps in many situations and it is a step in the right direction:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Best Regards, Petr
PS: There is no need to resend the patch. I could update the commit message when pushing the patch. I am just going to wait a bit for other potential reviewers.
| |