From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: David Rientjes <rientjes@google.com>
Cc: kosaki.motohiro@jp.fujitsu.com, "Figo.zhang" <figo1802@gmail.com>,
lkml <linux-kernel@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Andrew Morton <akpm@osdl.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH v2]mm/oom-kill: direct hardware access processes should get bonus
Date: Mon, 15 Nov 2010 10:24:38 +0900 (JST) [thread overview]
Message-ID: <20101115095446.BF00.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1011141322590.22262@chino.kir.corp.google.com>
> On Sun, 14 Nov 2010, KOSAKI Motohiro wrote:
>
> > > So the question that needs to be answered is: why do these threads deserve
> > > to use 3% more memory (not >4%) than others without getting killed? If
> > > there was some evidence that these threads have a certain quantity of
> > > memory they require as a fundamental attribute of CAP_SYS_RAWIO, then I
> > > have no objection, but that's going to be expressed in a memory quantity
> > > not a percentage as you have here.
> >
> > 3% is choosed by you :-/
> >
>
> No, 3% was chosen in __vm_enough_memory() for LSMs as the comment in the
> oom killer shows:
>
> /*
> * Root processes get 3% bonus, just like the __vm_enough_memory()
> * implementation used by LSMs.
> */
>
> and is described in Documentation/filesystems/proc.txt.
>
> I think in cases of heuristics like this where we obviously want to give
> some bonus to CAP_SYS_ADMIN that there is consistency with other bonuses
> given elsewhere in the kernel.
Keep comparision apple to apple. vm_enough_memory() account _virtual_ memory.
oom-killer try to free _physical_ memory. It's unrelated.
>
> > Old background is very simple and cleaner.
> >
>
> The old heuristic divided the arbitrary badness score by 4 with
> CAP_SYS_RESOURCE. The new heuristic doesn't consider it.
>
> How is that more clean?
>
> > CAP_SYS_RESOURCE mean the process has a privilege of using more resource.
> > then, oom-killer gave it additonal bonus.
> >
>
> As a side-effect of being given more resources to allocate, those
> applications are relatively unbounded in terms of memory consumption to
> other tasks. Thus, it's possible that these applications are using a
> massive amount of memory (say, 75%) and now with the proposed change a
> task using 25% of memory would be killed instead. This increases the
> liklihood that the CAP_SYS_RESOURCE thread will have to be killed
> eventually, anyway, and the goal is to kill as few tasks as possible to
> free sufficient amount of memory.
You are talking two difference at once. 3% vs 4x and CAP_SYS_RESOURCE and
CAP_SYS_ADMIN.
Please keep comparing apple to apple.
>
> Since threads having CAP_SYS_RESOURCE have full control over their
> oom_score_adj, they can take the additional precautions to protect
> themselves if necessary. It doesn't need to be a part of the heuristic to
> bias these tasks which will lead to the undesired result described above
> by default rather than intentionally from userspace.
>
> > CAP_SYS_RAWIO mean the process has a direct hardware access privilege
> > (eg X.org, RDB). and then, killing it might makes system crash.
> >
>
> Then you would want to explicitly filter these tasks from oom kill just as
> OOM_SCORE_ADJ_MIN works rather than giving them a memory quantity bonus.
No. Why does userland recover your mistake?
--
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/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-11-15 1:24 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-02 1:43 [PATCH]oom-kill: " Figo.zhang
2010-11-02 3:10 ` David Rientjes
2010-11-02 14:24 ` Figo.zhang
2010-11-02 19:34 ` David Rientjes
2010-11-03 23:43 ` [PATCH v2]oom-kill: CAP_SYS_RESOURCE " Figo.zhang
2010-11-03 23:47 ` David Rientjes
[not found] ` <AANLkTimjfmLzr_9+Sf4gk0xGkFjffQ1VcCnwmCXA88R8@mail.gmail.com>
2010-11-04 1:38 ` Figo.zhang
2010-11-04 1:50 ` David Rientjes
2010-11-04 2:12 ` Figo.zhang
2010-11-04 2:54 ` David Rientjes
2010-11-04 4:42 ` Figo.zhang
2010-11-04 5:08 ` David Rientjes
2010-11-09 11:01 ` [PATCH " KOSAKI Motohiro
2010-11-09 12:24 ` Alan Cox
2010-11-09 21:06 ` David Rientjes
2010-11-09 21:25 ` David Rientjes
2010-11-10 14:38 ` Figo.zhang
2010-11-10 20:50 ` David Rientjes
2010-11-09 10:41 ` [PATCH]oom-kill: direct hardware access processes " KOSAKI Motohiro
2010-11-09 12:24 ` [PATCH v2]mm/oom-kill: " Figo.zhang
2010-11-09 21:16 ` David Rientjes
2010-11-10 14:48 ` Figo.zhang
2010-11-14 5:07 ` KOSAKI Motohiro
2010-11-14 21:29 ` David Rientjes
2010-11-15 1:24 ` KOSAKI Motohiro [this message]
2010-11-15 10:03 ` David Rientjes
2010-11-23 7:16 ` KOSAKI Motohiro
2010-11-28 1:36 ` David Rientjes
2010-11-30 13:00 ` KOSAKI Motohiro
2010-11-30 20:05 ` David Rientjes
2010-11-10 15:14 ` [PATCH v3]mm/oom-kill: " Figo.zhang
2010-11-10 15:24 ` Figo.zhang
2010-11-10 21:00 ` David Rientjes
2010-11-14 5:21 ` KOSAKI Motohiro
2010-11-14 21:33 ` David Rientjes
2010-11-15 3:26 ` [PATCH] Revert oom rewrite series Figo.zhang
2010-11-15 10:14 ` David Rientjes
2010-11-15 10:57 ` Alan Cox
2010-11-15 20:54 ` David Rientjes
2010-11-23 7:16 ` KOSAKI Motohiro
2011-01-04 7:51 ` [PATCH v3]mm/oom-kill: direct hardware access processes should get bonus Figo.zhang
2011-01-04 8:28 ` KAMEZAWA Hiroyuki
2011-01-04 8:56 ` Figo.zhang
2011-01-06 0:55 ` KAMEZAWA Hiroyuki
2011-01-05 3:32 ` David Rientjes
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=20101115095446.BF00.A69D9226@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=akpm@osdl.org \
--cc=figo1802@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@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