[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180601091823.GA1841@jagdpanzerIV>
Date: Fri, 1 Jun 2018 18:18:23 +0900
From: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To: Petr Mladek <pmladek@...e.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
Maninder Singh <maninder1.s@...sung.com>,
sergey.senozhatsky@...il.com, rostedt@...dmis.org,
linux-kernel@...r.kernel.org, a.sahrawat@...sung.com,
pankaj.m@...sung.com, v.narang@...sung.com
Subject: Re: [PATCH 2/2] printk: make sure to print log on console.
On (06/01/18 10:53), Petr Mladek wrote:
> [...]
>
> > So I'd say that most likely the following scenarios can suffer:
> >
> > - NMI comes in, sets loglevel to X, printk-s some data, restores the
> > loglevel back to Y
> > - IRQ comes in [like sysrq, etc] comes in and does the same thing
> > - software exception comes in and does the same thing [e.g. bust_spinlocks()
> > at arch/s390/mm/fault.c]
>
>
> My view is:
>
> The race with another printk() (console_lock owner) is much more
> likely than a race between two CPUs manipulating console_loglevel.
The race with console_loglevel manipulation from another CPU was not
the main point [it is unlikely, like I said in my "nitpick"].
The point was
NMI / printk_safe section
saved_console_loglevel = console_loglevel
console_loglevel = A
printk
printk
printk
console_loglevel = saved_console_loglevel
iret
Is not handled.
> The proposed patch seems to be in the right direction. It is supposed
> to fix the most likely scenario.
Could be.
> I am personally fine with this partial solution for now. We could
> always make it better if people meet the other scenarios.
I don't have objections. But I'd prefer to see real uses cases and
to know why partial solution is good enough in this case, even though
we know that NMI / printk_safe() messages may be lost due to very same
problem.
-ss
Powered by blists - more mailing lists