linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhaoyang Huang <huangzhaoyang@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: 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 08:32:56 +0800	[thread overview]
Message-ID: <CAGWkznEhy7Fard=6E3X_qUezXd33RdKV9CVeONWL=6EQ1bokEw@mail.gmail.com> (raw)
In-Reply-To: <20180409094944.6399b211@gandalf.local.home>

On Mon, Apr 9, 2018 at 9:49 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> On Mon, 9 Apr 2018 08:56:01 +0800
> Zhaoyang Huang <huangzhaoyang@gmail.com> wrote:
>
>> >>
>> >>         if (oom_task_origin(task)) {
>> >>                 points = ULONG_MAX;
>> >>                 goto select;
>> >>         }
>> >>
>> >>         points = oom_badness(task, NULL, oc->nodemask, oc->totalpages);
>> >>         if (!points || points < oc->chosen_points)
>> >>                 goto next;
>> >
>> > And what's wrong with that?
>> >
>> > -- Steve
>> I think the original thought of OOM is the flag 'OOM_SCORE_ADJ_MIN' is
>> most likely to be set by process himself via accessing the proc file,
>> if it does so, OOM can select it as the victim. except, it is
>> reluctant to choose the critical process to be killed, so I suggest
>> not to set such heavy flag as OOM_SCORE_ADJ_MIN on behalf of -1000
>> process.
>
> Really, I don't think tasks that are setting OOM_CORE_ADJ_MIN should be
> allocating a lot of memory in the kernel (via ring buffer). It sounds
> like a good way to wreck havoc on the system.
>
> It's basically saying, "I'm going to take up all memory, but don't kill
> me, just kill some random user on the system".
>
> -- Steve
Sure, but the memory status is dynamic, the process could also exceed the limit
at the moment even it check the available memory before. We have to
add protection
for such kind of risk. It could also happen that the critical process
be preempted by
another huge memory allocating process, which may cause insufficient memory when
it schedule back.

  reply	other threads:[~2018-04-10  0:32 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-08  2:16 [PATCH v1] ringbuffer: Don't choose the process with adj equal OOM_SCORE_ADJ_MIN 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 [this message]
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
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='CAGWkznEhy7Fard=6E3X_qUezXd33RdKV9CVeONWL=6EQ1bokEw@mail.gmail.com' \
    --to=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;
as well as URLs for NNTP newsgroup(s).