Re: [PATCH v2] printk: make sure to print log on console.

From: Sergey Senozhatsky
Date: Wed Jun 20 2018 - 06:52:16 EST


On (06/19/18 09:26), Steven Rostedt wrote:
> >
> > But when I set /sys/module/printk/parameters/ignore_loglevel I naturally
> > expect it to take an immediate action. Without waiting for the consoles
> > to catch up and to discard N messages [if the consoles were behind the
> > logbuf head].
> >
> It's not that critical to have that change take immediate effect. It's
> not a common operation, and I doubt anyone (but perhaps you ;-) will
> even notice any difference.

Quite possibly.

In the background (what I didn't post) I thought that
console_verbose() sets ignore_loglevel. So we could have a race
condition - when console drags behind, something sets ignore_loglevel
but it takes a while before "all" messages actually start to appear
on the console.

In the foreground (what I posted) I thought that the whole
reason the patch exists was "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" So console_sem may
be scheduled out, or simply slow. Once again, it may take some time for
ignore_loglevel to take any effect.

But probably it's fine to have this new behaviour.

-ss