lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 1 Nov 2017 13:54:09 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Vlastimil Babka <vbabka@...e.cz>
Cc:     Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
        akpm@...ux-foundation.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, Cong Wang <xiyou.wangcong@...il.com>,
        Dave Hansen <dave.hansen@...el.com>,
        Johannes Weiner <hannes@...xchg.org>,
        Mel Gorman <mgorman@...e.de>, Michal Hocko <mhocko@...nel.org>,
        Petr Mladek <pmladek@...e.com>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        "yuwang.yuwang" <yuwang.yuwang@...baba-inc.com>
Subject: Re: [PATCH] mm: don't warn about allocations which stall for too
 long

On Wed, 1 Nov 2017 18:42:25 +0100
Vlastimil Babka <vbabka@...e.cz> wrote:

> On 11/01/2017 04:33 PM, Steven Rostedt wrote:
> > On Wed, 1 Nov 2017 09:30:05 +0100
> > Vlastimil Babka <vbabka@...e.cz> wrote:
> >   
> >>
> >> But still, it seems to me that the scheme only works as long as there
> >> are printk()'s coming with some reasonable frequency. There's still a
> >> corner case when a storm of printk()'s can come that will fill the ring
> >> buffers, and while during the storm the printing will be distributed
> >> between CPUs nicely, the last unfortunate CPU after the storm subsides
> >> will be left with a large accumulated buffer to print, and there will be
> >> no waiters to take over if there are no more printk()'s coming. What
> >> then, should it detect such situation and defer the flushing?  
> > 
> > No!
> > 
> > If such a case happened, that means the system is doing something
> > really stupid.  
> 
> Hm, what about e.g. a soft lockup that triggers backtraces from all
> CPU's? Yes, having softlockups is "stupid" but sometimes they do happen
> and the system still recovers (just some looping operation is missing
> cond_resched() and took longer than expected). It would be sad if it
> didn't recover because of a printk() issue...

I still think such a case would not be huge for the last printer.

> 
> > Btw, each printk that takes over, does one message, so the last one to
> > take over, shouldn't have a full buffer anyway.  
> 
> There might be multiple messages per each CPU, e.g. the softlockup
> backtraces.

And each one does multiple printks, still spreading the love around.

> 
> > But still, if you have such a hypothetical situation, the system should
> > just crash. The printk is still bounded by the length of the buffer.
> > Although it is slow, it will finish.  
> 
> Finish, but with single CPU doing the printing, which is wrong?

I don't think so. This is all hypothetical anyway. I need to implement
my solution, and then lets see if this can actually happen.

> 
> > Which is not the case with the
> > current situation. And the current situation (as which this patch
> > demonstrates) does happen today and is not hypothetical.  
> 
> Yep, so ideally it can be fixed without corner cases :)

If there is any corner cases. I guess the test would be to trigger a
soft lockup on all CPUs to print out a dump at the same time. But then
again, how is a soft lockup on all CPUs not any worse than a single CPU
finishing up the buffer output?

-- Steve

Powered by blists - more mailing lists