linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: "Figo.zhang" <figo1802@gmail.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	"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: Tue, 9 Nov 2010 13:16:12 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.00.1011091307240.7730@chino.kir.corp.google.com> (raw)
In-Reply-To: <1289305468.10699.2.camel@localhost.localdomain>

On Tue, 9 Nov 2010, Figo.zhang wrote:

>  
> the victim should not directly access hardware devices like Xorg server,
> because the hardware could be left in an unpredictable state, although 
> user-application can set /proc/pid/oom_score_adj to protect it. so i think
> those processes should get 3% bonus for protection.
> 

The logic here is wrong: if killing these tasks can leave hardware in an 
unpredictable state (and that state is presumably harmful), then they 
should be completely immune from oom killing since you're still leaving 
them exposed here to be killed.

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.

The CAP_SYS_ADMIN heuristic has a background: it is used in the oom killer 
because we have used the same 3% in __vm_enough_memory() for a long time 
and we want consistency amongst the heuristics.  Adding additional bonuses 
with arbitrary values like 3% of memory for things like CAP_SYS_RAWIO 
makes the heuristic less predictable and moves us back toward the old 
heuristic which was almost entirely arbitrary.

Now before KOSAKI-san comes out and says the old heuristic considered 
CAP_SYS_RAWIO and the new one does not so it _must_ be a regression: the 
old heuristic also divided the badness score by 4 for that capability as a 
completely arbitrary value (just like 3% is here).  Other traits like 
runtime and nice levels were also removed from the heuristic.  What needs 
to be shown is that CAP_SYS_RAWIO requires additional memory just to run 
or we should neglect to free 3% of memory, which could be gigabytes, 
because it has this trait.

  reply	other threads:[~2010-11-09 21:16 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-02  1:43 [PATCH]oom-kill: direct hardware access processes should get bonus 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 [this message]
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
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=alpine.DEB.2.00.1011091307240.7730@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@osdl.org \
    --cc=figo1802@gmail.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --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;
as well as URLs for NNTP newsgroup(s).