linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: peter enderborg <peter.enderborg@sonymobile.com>
Cc: "Martijn Coenen" <maco@google.com>,
	"John Stultz" <john.stultz@linaro.org>,
	"Greg KH" <gregkh@linuxfoundation.org>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Riley Andrews" <riandrews@android.com>,
	devel@driverdev.osuosl.org, LKML <linux-kernel@vger.kernel.org>,
	Linux-MM <linux-mm@kvack.org>, "Todd Kjos" <tkjos@google.com>,
	"Android Kernel Team" <kernel-team@android.com>,
	"Rom Lemarchand" <romlem@google.com>,
	"Tim Murray" <timmurray@google.com>
Subject: Re: [PATCH] staging, android: remove lowmemory killer from the tree
Date: Fri, 24 Feb 2017 15:11:44 +0100	[thread overview]
Message-ID: <20170224141144.GI19161@dhcp22.suse.cz> (raw)
In-Reply-To: <9ffdcc79-12d4-00c5-182c-498b8ca951cc@sonymobile.com>

On Fri 24-02-17 14:16:34, peter enderborg wrote:
> On 02/24/2017 01:28 PM, Michal Hocko wrote:
[...]
> > Yeah, I strongly believe that the chosen approach is completely wrong.
> > Both in abusing the shrinker interface and abusing oom_score_adj as the
> > only criterion for the oom victim selection.
> 
> No one is arguing that shrinker is not problematic. And would be great
> if it is removed from lmk.  The oom_score_adj is the way user-space
> tells the kernel what the user-space has as prio. And android is using
> that very much. It's a core part.

Is there any documentation which describes how this is done?

> I have never seen it be used on
> other linux system so what is the intended usage of oom_score_adj? Is
> this really abusing?

oom_score_adj is used to _adjust_ the calculated oom score. It is not a
criterion on its own, well, except for the extreme sides of the range
which are defined to enforce resp. disallow selecting the task. The
global oom killer calculates the oom score as a function of the memory
consumption. Your patch simply ignores the memory consumption (and uses
pids to sort tasks with the same oom score which is just mind boggling)
and that is what I call the abuse. The oom score calculation might
change in future, of course, but all consumers of the oom_score_adj
really have to agree on the base which is adjusted by this tunable
otherwise you can see a lot of unexpected behavior.

I would even argue that nobody outside of mm/oom_kill.c should really
have any business with this tunable.  You can of course tweak the value
from the userspace and help to chose a better oom victim this way but
that is it.

Anyway, I guess we are getting quite off-topic here.

-- 
Michal Hocko
SUSE Labs

--
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-02-24 14:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-22 12:01 Michal Hocko
2017-02-23 20:24 ` John Stultz
2017-02-23 20:28   ` Todd Kjos
2017-02-23 20:36   ` Martijn Coenen
2017-02-24  9:34     ` Michal Hocko
2017-02-24 18:38       ` Tim Murray
2017-02-24 18:42         ` Rom Lemarchand
2017-03-04  2:06           ` Tim Murray
2017-02-24 12:19     ` peter enderborg
2017-02-24 12:28       ` Michal Hocko
2017-02-24 13:16         ` peter enderborg
2017-02-24 14:11           ` Michal Hocko [this message]
2017-02-24 14:42             ` peter enderborg
2017-02-24 15:03               ` Michal Hocko
2017-02-24 15:40                 ` peter enderborg
2017-02-24 15:52                   ` Michal Hocko
2017-02-24  9:38   ` Michal Hocko
2017-03-09  9:15 ` Michal Hocko
2017-03-09  9:30   ` Greg KH
2017-03-09 10:00     ` Michal Hocko
2017-03-09 12:48       ` Greg KH

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=20170224141144.GI19161@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=arve@android.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=john.stultz@linaro.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=maco@google.com \
    --cc=peter.enderborg@sonymobile.com \
    --cc=riandrews@android.com \
    --cc=romlem@google.com \
    --cc=timmurray@google.com \
    --cc=tkjos@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox