From: Andrew Morton <akpm@linux-foundation.org>
To: cminyard@mvista.com
Cc: Michal Hocko <mhocko@suse.com>,
minyard@acm.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] oom_kill: oom_score_adj broken for processes with small memory usage
Date: Thu, 2 Sep 2021 12:55:01 -0700 [thread overview]
Message-ID: <20210902125501.c83101f27f1a02c58188e3f3@linux-foundation.org> (raw)
In-Reply-To: <20210716122547.GI3431@minyard.net>
On Fri, 16 Jul 2021 07:25:47 -0500 Corey Minyard <cminyard@mvista.com> wrote:
> On Fri, Jul 16, 2021 at 07:19:24AM +0200, Michal Hocko wrote:
> > On Thu 01-07-21 07:54:30, minyard@acm.org wrote:
> > > From: Corey Minyard <cminyard@mvista.com>
> > >
> > > If you have a process with less than 1000 totalpages, the calculation:
> > >
> > > adj = (long)p->signal->oom_score_adj;
> > > ...
> > > adj *= totalpages / 1000;
> > >
> > > will always result in adj being zero no matter what oom_score_adj is,
> > > which could result in the wrong process being picked for killing.
> > >
> > > Fix by adding 1000 to totalpages before dividing.
> >
> > Yes, this is a known limitation of the oom_score_adj and its scale.
> > Is this a practical problem to be solved though? I mean 0-1000 pages is
> > not really that much different from imprecision at a larger scale where
> > tasks are effectively considered equal.
>
> Known limitation? Is this documented? I couldn't find anything that
> said "oom_score_adj doesn't work at all with programs with <1000 pages
> besides setting the value to -1000".
>
> >
> > I have to say I do not really like the proposed workaround. It doesn't
> > really solve the problem yet it adds another special case.
>
> The problem is that if you have a small program, there is no way to
> set it's priority besides completely disablling the OOM killer for
> it.
>
> I don't understand the special case comment. How is this adding a
> special case? This patch removes a special case. Small programs
> working different than big programs is a special case. Making them all
> work the same is removing an element of surprise from someone expecting
> things to work as documented.
>
Can we please get this resolved one way or the other?
next prev parent reply other threads:[~2021-09-02 19:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-01 12:54 [PATCH] oom_kill: oom_score_adj broken for processes with small memory usage minyard
2021-07-16 5:19 ` Michal Hocko
2021-07-16 12:25 ` Corey Minyard
2021-09-02 19:55 ` Andrew Morton [this message]
2021-09-03 1:52 ` Corey Minyard
2021-09-03 7:49 ` Michal Hocko
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=20210902125501.c83101f27f1a02c58188e3f3@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=cminyard@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=minyard@acm.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).