linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Paul Jackson <pj@sgi.com>,
	andrea@suse.de, akpm@linux-foundation.org, linux-mm@kvack.org
Subject: Re: [patch 4/4] oom: serialize for cpusets
Date: Thu, 28 Jun 2007 21:07:26 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.0.99.0706282055170.21525@chino.kir.corp.google.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0706281830280.9573@schroedinger.engr.sgi.com>

On Thu, 28 Jun 2007, Christoph Lameter wrote:

> > If you attach all your system tasks to a single small node and then 
> > attempt to allocate large amounts of memory in that node, tasks get killed 
> > unnecessarily.  This is a good way to approximate a cpuset's memory 
> > pressure in real-world examples.  The actual rogue task can avoid getting 
> > killed by simply not allocating the last N kB in that node while other 
> > tasks, such as sshd or sendmail, require memory on a spurious basis.  So 
> > we've often seen tasks such as those get OOM killed even though they don't 
> > alleviate the condition much at all: sshd and sendmail are not normally 
> > memory hogs.
> 
> Yeah but to get there seems to require intention on the part of the 
> rogue tasks.
> 

I'm confused.  The "rogue" task has avoided getting killed because it just 
barely got the memory it required and now other tasks, such as the 
examples of sendmail or sshd, which have spurious memory usage will get 
killed with current git and probably not do a darn thing to alleviate the 
OOM condition.  That's broken behavior.

> > The much better policy in terms of sharing memory among a cpuset's task is 
> > to kill the actual rogue task which we can estimate pretty well with 
> > select_bad_process() since it takes into consideration, most importantly, 
> > the total VM size.
> 
> Sorry that is too expensive. I did not see that initially. Thanks Paul for 
> reminding me. I am at the OLS and my mindshare for this is pretty limited 
> right now.
> 

Please see patch 5 posted today which uses select_bad_process() to find 
the task to kill the default but allows you to
echo 1 > /dev/cpuset/my_cpuset/oom_kill_asking_task to cheaply kill 
current instead.

And can you please explain why this is only objected to in the 
CONSTRAINT_CPUSET case and not CONSTRAINT_NONE where this is an even more 
expensive operation?

> The current behavior will usually kill the memory hogging task and it can 
> do so with minimal effort. If there is a whole array of memory hogging 
> tasks then the existing approach will be much easier on the system.
> 

No, it kills the current task.  You cannot make the inference that the 
task that exceeded the available cpuset memory is the one that should be 
killed.  And if you do, you'll kill tasks unnecessarily regardless of 
whether the cpuset OOM killer is serialized or not.

If my application requests more memory than it should have or it's 
leaking but it hasn't yet reached an OOM state and then sshd wants a small 
amount of memory and OOM's, we kill it even though it's futile because my 
application is going to continue to leak.  Eventually we'll get around to 
killing my application because of scheduling decisions and I will OOM, but 
sshd and any other task that was unlucky enough to be scheduled before me 
will already be dead.  That's broken behavior, but we have enabled it 
through the oom_kill_asking_task flag on a per-cpuset basis for special 
situations where killing current would be acceptable.

		David

--
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:[~2007-06-29  4:07 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-27 14:44 [patch 1/4] oom: extract deadlock helper function David Rientjes
2007-06-27 14:44 ` [patch 2/4] oom: select process to kill for cpusets David Rientjes
2007-06-27 14:44   ` [patch 3/4] oom: extract select helper function David Rientjes
2007-06-27 14:44     ` [patch 4/4] oom: serialize for cpusets David Rientjes
2007-06-27 21:53       ` Christoph Lameter
2007-06-27 22:13         ` Paul Jackson
2007-06-28  6:24           ` David Rientjes
2007-06-28  7:33             ` Paul Jackson
2007-06-28  8:05               ` David Rientjes
2007-06-28  9:03                 ` Paul Jackson
2007-06-28 18:13                   ` David Rientjes
2007-06-28 18:55                     ` Paul Jackson
2007-06-28 19:27                       ` Paul Menage
2007-06-28 20:15                         ` Paul Jackson
2007-06-28 20:43                       ` David Rientjes
2007-06-29  1:33                     ` Christoph Lameter
2007-06-29  4:07                       ` David Rientjes [this message]
2007-06-28  0:26         ` Andrea Arcangeli
2007-06-28 20:41       ` [patch 5/4] oom: add oom_kill_asking_task flag David Rientjes
2007-06-28 22:07         ` Paul Jackson
2007-06-27 21:52   ` [patch 2/4] oom: select process to kill for cpusets Christoph Lameter
2007-06-28  6:13     ` David Rientjes
2007-07-26  6:15 ` [patch 1/4] oom: extract deadlock helper function David Rientjes
2007-07-26  6:25   ` Andrew Morton
2007-07-26  7:29     ` 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.0.99.0706282055170.21525@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrea@suse.de \
    --cc=clameter@sgi.com \
    --cc=linux-mm@kvack.org \
    --cc=pj@sgi.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