mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Zhaoyang Huang <huangzhaoyang@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] ringbuffer: Don't choose the process with adj equal OOM_SCORE_ADJ_MIN
Date: Tue, 10 Apr 2018 09:49:21 +0200	[thread overview]
Message-ID: <20180410074921.GU21835@dhcp22.suse.cz> (raw)
In-Reply-To: <CAGWkznGrugH0VqJyd5ZPiSBMOZ4SbbNpKiHVXM27Q-ep4SYb-Q@mail.gmail.com>

On Tue 10-04-18 14:39:35, Zhaoyang Huang wrote:
> On Tue, Apr 10, 2018 at 2:14 PM, Michal Hocko <mhocko@kernel.org> wrote:
> > On Tue 10-04-18 11:41:44, Zhaoyang Huang wrote:
> >> On Tue, Apr 10, 2018 at 11:12 AM, Steven Rostedt <rostedt@goodmis.org> wrote:
> >> > On Tue, 10 Apr 2018 10:32:36 +0800
> >> > Zhaoyang Huang <huangzhaoyang@gmail.com> wrote:
> >> >
> >> >> For bellowing scenario, process A have no intension to exhaust the
> >> >> memory, but will be likely to be selected by OOM for we set
> >> >> OOM_CORE_ADJ_MIN for it.
> >> >> process A(-1000)                                          process B
> >> >>
> >> >>   i = si_mem_available();
> >> >>        if (i < nr_pages)
> >> >>            return -ENOMEM;
> >> >>                                                    schedule
> >> >>                                                 --------------->
> >> >> allocate huge memory
> >> >>                                                 <-------------
> >> >> if (user_thread)
> >> >>   set_current_oom_origin();
> >> >>
> >> >>   for (i = 0; i < nr_pages; i++) {
> >> >>          bpage = kzalloc_node
> >> >
> >> > Is this really an issue though?
> >> >
> >> > Seriously, do you think you will ever hit this?
> >> >
> >> > How often do you increase the size of the ftrace ring buffer? For this
> >> > to be an issue, the system has to trigger an OOM at the exact moment
> >> > you decide to increase the size of the ring buffer. That would be an
> >> > impressive attack, with little to gain.
> >> >
> >> > Ask the memory management people. If they think this could be a
> >> > problem, then I'll be happy to take your patch.
> >> >
> >> > -- Steve
> >> add Michael for review.
> >> Hi Michael,
> >> I would like suggest Steve NOT to set OOM_CORE_ADJ_MIN for the process
> >> with adj = -1000 when setting the user space process as potential
> >> victim of OOM.
> >
> > OOM_SCORE_ADJ_MIN means "hide the process from the OOM killer completely".
> > So what exactly do you want to achieve here? Because from the above it
> > sounds like opposite things. /me confused...
> >
> Steve's patch intend to have the process be OOM's victim when it
> over-allocating pages for ring buffer. I amend a patch over to protect
> process with OOM_SCORE_ADJ_MIN from doing so. Because it will make
> such process to be selected by current OOM's way of
> selecting.(consider OOM_FLAG_ORIGIN first before the adj)

I just wouldn't really care unless there is an existing and reasonable
usecase for an application which updates the ring buffer size _and_ it
is OOM disabled at the same time.
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2018-04-10  7:49 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-08  2:16 Zhaoyang Huang
2018-04-08  3:48 ` Steven Rostedt
2018-04-08  5:54   ` Zhaoyang Huang
2018-04-08 12:47     ` Steven Rostedt
2018-04-09  0:56       ` Zhaoyang Huang
2018-04-09 13:49         ` Steven Rostedt
2018-04-10  0:32           ` Zhaoyang Huang
2018-04-10  2:32             ` Zhaoyang Huang
2018-04-10  3:12               ` Steven Rostedt
2018-04-10  3:41                 ` Zhaoyang Huang
2018-04-10  6:14                   ` Michal Hocko
2018-04-10  6:39                     ` Zhaoyang Huang
2018-04-10  7:49                       ` Michal Hocko [this message]
2018-04-10  8:04                         ` Zhaoyang Huang
2018-04-10  8:12                           ` Michal Hocko
2018-04-10  8:38                             ` Zhaoyang Huang
2018-04-10  9:01                               ` Michal Hocko
2018-04-10  9:32                                 ` Zhaoyang Huang
2018-04-10  9:51                                   ` Zhaoyang Huang
2018-04-10 10:49                                   ` Michal Hocko
2018-04-10 12:23                                     ` Steven Rostedt
2018-04-10 12:27                                       ` Michal Hocko
2018-04-10 12:36                                         ` Steven Rostedt
2018-04-10 13:13                                           ` Steven Rostedt
2018-04-10 13:14                                             ` Steven Rostedt
2018-04-10 16:45                                             ` Joel Fernandes
2018-04-10 18:00                                               ` Steven Rostedt
2018-04-10 18:39                                                 ` Joel Fernandes
2018-04-10 19:05                                                   ` Steven Rostedt
2018-04-11  7:48                                                   ` Zhaoyang Huang

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=20180410074921.GU21835@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=huangzhaoyang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.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

all inboxes | Powered by JetHome®