linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Roman Gushchin <guro@fb.com>, ShakeelButt <shakeelb@google.com>,
	linux-mm@kvack.org,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] mm, oom: avoid printk() iteration under RCU
Date: Sun, 22 Sep 2019 08:20:40 +0200	[thread overview]
Message-ID: <20190922062040.GA18814@dhcp22.suse.cz> (raw)
In-Reply-To: <11c42f07-74d1-d4be-99bc-ca50d7c0ec71@i-love.sakura.ne.jp>

On Sun 22-09-19 08:47:31, Tetsuo Handa wrote:
> On 2019/09/22 5:30, Michal Hocko wrote:
> > On Fri 20-09-19 17:10:42, Andrew Morton wrote:
> >> On Sat, 20 Jul 2019 20:29:23 +0900 Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote:
> >>
> >>>>
> >>>>> ) under RCU and this patch is one of them (except that we can't remove
> >>>>> printk() for dump_tasks() case).
> >>>>
> >>>> No, this one adds a complexity for something that is not clearly a huge
> >>>> win or the win is not explained properly.
> >>>>
> >>>
> >>> The win is already explained properly by the past commits. Avoiding RCU stalls
> >>> (even without slow consoles) is a clear win. The duration of RCU stall avoided
> >>> by this patch is roughly the same with commit b2b469939e934587.
> >>>
> >>> We haven't succeeded making printk() asynchronous (and potentially we won't
> >>> succeed making printk() asynchronous because we need synchronous printk()
> >>> when something critical is undergoing outside of out_of_memory()). Thus,
> >>> bringing printk() to outside of RCU section is a clear win we can make for now.
> >>
> >> It's actually not a complex patch and moving all that printing outside
> >> the rcu section makes sense.  So I'll sit on the patch for a few more
> >> days but am inclined to send it upstream.
> > 
> > Look, I am quite tired of arguing about this and other changes following
> > the similar pattern. In short a problematic code is shuffled around and
> > pretend to solve some problem. In this particular case it is a RCU stall
> > which in itself is not a fatal condition. Sure it sucks and the primary
> > reason is that printk can take way too long. This is something that is
> > currently a WIP to be address. What is more important though there is no
> > sign of any _real world_ workload that would require a quick workaround
> > to justify a hacky stop gap solution.
> > 
> > So again, why do we want to add more code for something which is not
> > clear to be a real life problem and that will add a maintenance burden
> > for future?
> > 
> 
> Enqueueing zillion printk() lines from dump_tasks() will overflow printk
> buffer (i.e. leads to lost messages) if OOM killer messages were printed
> asynchronously. I don't think that making printk() asynchronous will solve
> this problem. I repeat again; there is no better solution than "printk()
> users are careful not to exhaust the printk buffer". This patch is the
> first step towards avoiding thoughtless printk().

Irrelevant because this patch doesn't reduce the amount of output.

> Delay from dump_tasks() not only affects a thread holding oom_lock but also
> other threads which are directly doing concurrent allocation requests or
> indirectly waiting for the thread holding oom_lock. Your "it is a RCU stall
> which in itself is not a fatal condition" is underestimating the _real world_
> problems (e.g. "delay can trigger watchdog timeout and cause the system to
> reboot even if the administrator does not want the system to reboot").

Please back your claims by real world examples.
-- 
Michal Hocko
SUSE Labs


  parent reply	other threads:[~2019-09-22  6:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-17 10:55 Tetsuo Handa
2019-07-18  0:31 ` Shakeel Butt
2019-07-18 10:22   ` Tetsuo Handa
2019-07-18  8:30 ` Michal Hocko
2019-07-18 13:50   ` Tetsuo Handa
2019-07-18 14:02     ` Michal Hocko
2019-07-20 11:29       ` Tetsuo Handa
     [not found]         ` <20190920171042.8d970f9fc6f360de9b20ebbe@linux-foundation.org>
2019-09-21 20:30           ` Michal Hocko
     [not found]             ` <11c42f07-74d1-d4be-99bc-ca50d7c0ec71@i-love.sakura.ne.jp>
2019-09-22  6:20               ` Michal Hocko [this message]
     [not found]                 ` <e4fac741-7dbc-41a1-7b9e-249415fba612@i-love.sakura.ne.jp>
2019-09-23  8:23                   ` Michal Hocko
2019-07-23 23:14 ` Andrew Morton
2019-07-24  1:47   ` Tetsuo Handa

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=20190922062040.GA18814@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=guro@fb.com \
    --cc=linux-mm@kvack.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=shakeelb@google.com \
    --cc=torvalds@linux-foundation.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox