[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180305214701.7434d030@gandalf.local.home>
Date: Mon, 5 Mar 2018 21:47:01 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Cc: "Qixuan.Wu" <qixuan.wu@...ux.alibaba.com>,
linux-kernel-owner <linux-kernel-owner@...r.kernel.org>,
Petr Mladek <pmladek@...e.com>, Jan Kara <jack@...e.cz>,
linux-kernel <linux-kernel@...r.kernel.org>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
"chenggang.qin" <chenggang.qin@...ux.alibaba.com>,
caijingxian <caijingxian@...ux.alibaba.com>,
"yuanliang.wyl" <yuanliang.wyl@...baba-inc.com>
Subject: Re: Would you help to tell why async printk solution was not taken
to upstream kernel ?
On Tue, 6 Mar 2018 11:00:26 +0900
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com> wrote:
> On (03/05/18 15:45), Steven Rostedt wrote:
> > On Mon, 5 Mar 2018 11:14:16 +0900
> > Sergey Senozhatsky <sergey.senozhatsky.work@...il.com> wrote:
> >
> > > It can print more than "one full buffer worth". In theory and on practice.
> >
> > How so? As soon as another process adds to the buffer, it will take
> > over the printing.
>
> The very same CPU which holds the console_sem can add messages to the
> logbuf.
>
> There are at least 3 cases I can easily think of.
>
>
> #1 preemption under console_sem
>
> console_lock()
> for (;;) {
> local_irq_save()
> call_console_drivers()
> local_irq_restore()
> << preemption >>
At this moment all watchdogs are working fine. And the continuing will
be done as if it was the first printk. No lockup eminent.
> printk // from another task, same CPU
> }
>
>
> #2 IRQ->printk under console_sem
>
> console_lock()
> for (;;) {
> local_irq_save()
> call_console_drivers()
> local_irq_restore()
> << IRQ >>
> printk
So basically, the CPU is just printing what that CPU is printing. It
only becomes an issue if the system has an issue (one CPU spamming
printk). Which is another bug.
> }
>
>
> #3 This, eventually, becomes #2. But the root cause and, thus,
> probability are completely different. printks from console drivers
> (some console drivers are really complex, with dependencies on timers,
> networking, etc. etc.). We currently handle those via
> printk_safe -> IRQ work. But I think we kinda should stop doing so.
>
> console_lock()
> for (;;) {
> local_irq_save()
> call_console_drivers()
> printk()
Which is another issue as well. But this is due to issues with printk
having issues, and is a different category of bug.
#2 and #3 are more recursive bugs and not a "printk locks up due to
other CPUs" kind of bug.
-- Steve
> local_irq_restore()
> }
>
> -ss
Powered by blists - more mailing lists