All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Mel Gorman <mgorman@suse.de>, Michal Hocko <mhocko@kernel.org>,
	Petr Mladek <pmladek@suse.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	"yuwang.yuwang" <yuwang.yuwang@alibaba-inc.com>
Subject: Re: [PATCH] mm: don't warn about allocations which stall for too long
Date: Wed, 1 Nov 2017 13:54:09 -0400	[thread overview]
Message-ID: <20171101135409.0190afb1@gandalf.local.home> (raw)
In-Reply-To: <40ed01d3-1475-cd4a-0dff-f7a6ee24d5e9@suse.cz>

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

> On 11/01/2017 04:33 PM, Steven Rostedt wrote:
> > On Wed, 1 Nov 2017 09:30:05 +0100
> > Vlastimil Babka <vbabka@suse.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

WARNING: multiple messages have this Message-ID (diff)
From: Steven Rostedt <rostedt@goodmis.org>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Mel Gorman <mgorman@suse.de>, Michal Hocko <mhocko@kernel.org>,
	Petr Mladek <pmladek@suse.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	"yuwang.yuwang" <yuwang.yuwang@alibaba-inc.com>
Subject: Re: [PATCH] mm: don't warn about allocations which stall for too long
Date: Wed, 1 Nov 2017 13:54:09 -0400	[thread overview]
Message-ID: <20171101135409.0190afb1@gandalf.local.home> (raw)
In-Reply-To: <40ed01d3-1475-cd4a-0dff-f7a6ee24d5e9@suse.cz>

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

> On 11/01/2017 04:33 PM, Steven Rostedt wrote:
> > On Wed, 1 Nov 2017 09:30:05 +0100
> > Vlastimil Babka <vbabka@suse.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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-11-01 17:54 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-26 11:28 [PATCH] mm: don't warn about allocations which stall for too long Tetsuo Handa
2017-10-26 11:28 ` Tetsuo Handa
2017-10-26 11:41 ` Michal Hocko
2017-10-26 11:41   ` Michal Hocko
2017-11-08 10:30   ` peter enderborg
2017-11-09  8:52     ` Michal Hocko
2017-11-09  8:52       ` Michal Hocko
2017-11-09  9:34       ` peter enderborg
2017-11-09 10:09         ` Michal Hocko
2017-11-09 10:09           ` Michal Hocko
2017-11-09 10:19           ` Tetsuo Handa
2017-11-09 10:19             ` Tetsuo Handa
2017-10-26 14:37 ` Johannes Weiner
2017-10-26 14:37   ` Johannes Weiner
2017-10-31 19:32 ` Steven Rostedt
2017-11-01  8:30   ` Vlastimil Babka
2017-11-01  8:30     ` Vlastimil Babka
2017-11-01 13:38     ` Petr Mladek
2017-11-01 13:38       ` Petr Mladek
2017-11-01 15:36       ` Steven Rostedt
2017-11-01 15:36         ` Steven Rostedt
2017-11-02 11:46         ` Petr Mladek
2017-11-02 11:46           ` Petr Mladek
2017-11-02 14:49           ` Steven Rostedt
2017-11-02 14:49             ` Steven Rostedt
2017-11-01 15:33     ` Steven Rostedt
2017-11-01 15:33       ` Steven Rostedt
2017-11-01 17:42       ` Vlastimil Babka
2017-11-01 17:42         ` Vlastimil Babka
2017-11-01 17:54         ` Steven Rostedt [this message]
2017-11-01 17:54           ` Steven Rostedt
2017-11-02  8:53   ` Sergey Senozhatsky
2017-11-02  8:53     ` Sergey Senozhatsky
2017-11-02  9:14     ` Sergey Senozhatsky
2017-11-02  9:14       ` Sergey Senozhatsky
2017-11-02 14:55     ` Steven Rostedt
2017-11-02 14:55       ` Steven Rostedt
2017-11-02 12:55   ` Michal Hocko
2017-11-02 12:55     ` Michal Hocko
2017-11-02 15:56 ` Steven Rostedt
2017-11-02 15:56   ` Steven Rostedt
2017-11-02 17:06   ` [PATCH v2] printk: Add console owner and waiter logic to load balance console writes Steven Rostedt
2017-11-02 17:06     ` Steven Rostedt
2017-11-02 17:10     ` Steven Rostedt
2017-11-02 17:10       ` Steven Rostedt
2017-11-02 17:38     ` Steven Rostedt
2017-11-02 17:38       ` Steven Rostedt
2017-11-03 10:19     ` Jan Kara
2017-11-03 10:19       ` Jan Kara
2017-11-03 11:18       ` Steven Rostedt
2017-11-03 11:18         ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171101135409.0190afb1@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=pmladek@suse.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=vbabka@suse.cz \
    --cc=xiyou.wangcong@gmail.com \
    --cc=yuwang.yuwang@alibaba-inc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.