Re: [PATCH 2/2] printk: make sure to print log on console.
From: Sergey Senozhatsky
Date: Fri Jun 01 2018 - 05:37:50 EST
On (06/01/18 11:09), 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]
>
> I forgot to say that it was a great point and analyze.
Thanks :)
> > 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 proposed patch seems to be in the right direction. It is supposed
> > to fix the most likely scenario. We could block it and request full
> > solution but I wonder if it is worth it.
> >
> > I am personally fine with this partial solution for now. We could
> > always make it better if people meet the other scenarios.
>
> I am still fine with the partial solution. Well, I will think
> more about it before approving any patch.
Same here. I don't mind the patch and can agree with this partial
solution [may be we are missing more cases?]. Probably will need
a little bit more time.
-ss