Re: [PATCH 2/2] Subject: printk: Don't trap random context in infinite log_buf flush

Sergey Senozhatsky
2017-11-04T04:24:13Z

On (11/02/17 06:52), Tejun Heo wrote:
>
> When printk flushing isn't contended, whoever creates messages get to
> flush them, which is great in both fairness and keeping log delivery
> synchronous. However, when console drivers can't keep up with the
> rate of new messages, which happens a lot, who ends up with the
> flushing duty is determined by timing and everyone else's messages
> become asynchronous.

Hello Tejun,

thanks for the patch set. we are currently looking at another approach:
lkml.kernel.org/r/20171102134515.6eef16de@gandalf.local.home

would you be interested in taking a look?

there are some concerns, like a huge number of printk-s happening while
console_sem is locked. e.g. console_lock()/console_unlock() on one of the
CPUs, or console_lock(); printk(); ... printk(); console_unlock();

>
> the problem of "the last printk()", which will take
> over and do the flush.
>
> CPU0 CPU1 ~ CPU99
> console_lock();
> printk(); ... printk();
> console_unlock();
> IRQ on CPU2
> printk()
> // take over console_sem
> console_unlock()
>

-ss