From: David Rientjes <rientjes@google.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Andrea Arcangeli <andrea@suse.de>,
linux-mm@kvack.org, pj@sgi.com
Subject: Re: [patch 2/4] oom: select process to kill for cpusets
Date: Wed, 27 Jun 2007 23:13:24 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.0.99.0706272305260.12292@chino.kir.corp.google.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0706271448440.31852@schroedinger.engr.sgi.com>
On Wed, 27 Jun 2007, Christoph Lameter wrote:
> > @@ -423,12 +430,6 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
> > break;
> >
> > case CONSTRAINT_CPUSET:
> > - read_lock(&tasklist_lock);
> > - oom_kill_process(current, points,
> > - "No available memory in cpuset", gfp_mask, order);
> > - read_unlock(&tasklist_lock);
> > - break;
> > -
> > case CONSTRAINT_NONE:
> > if (down_trylock(&OOM_lock))
> > break;
>
> Would be better if this would now become an "if" instead of "switch". You
> only got two branches.
>
The fourth patch in the series actually uses CONSTRAINT_CPUSET differently
than CONSTRAINT_NONE when the select_bad_process()->oom_kill_process()
calls get moved to a helper function. The difference is due to the
locking that we require: in the CONSTRAINT_CPUSET case, we need to "lock"
the CS_OOM flag in p->cpuset->flags and in the CONSTRAINT_NONE case, we
need to lock Andrea's OOM_lock. So maintaining the switch clause is
better but, if patches 3-4 aren't applied, we can certainly change it to
an if.
> > @@ -453,9 +454,17 @@ retry:
> > * Rambo mode: Shoot down a process and hope it solves whatever
> > * issues we may have.
> > */
> > - p = select_bad_process(&points);
> > + p = select_bad_process(&points, constraint);
> > /* Found nothing?!?! Either we hang forever, or we panic. */
> > if (unlikely(!p)) {
> > + /*
> > + * We shouldn't panic the entire system if we can't
> > + * find any eligible tasks to kill in a
> > + * cpuset-constrained OOM condition. Instead, we do
> > + * nothing and allow other cpusets to continue.
> > + */
> > + if (constraint == CONSTRAINT_CPUSET)
> > + goto out;
>
> Put something into the syslog to note the strange condition?
>
Sure. Unfortunately there's probably a high liklihood that we'll never
get out of the OOM condition for that cpuset so we'd need to check the
time elapsed since p->cpuset->last_tif_memdie_jiffies and print the
diagnostic at a set interval. A static automatic variable doesn't work to
limit the printk because it's also plausible that we can OOM, get stuck
without any killable tasks, eventually free some memory, and then OOM
again later in that cpuset.
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>
next prev parent reply other threads:[~2007-06-28 6:13 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
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 [this message]
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.0706272305260.12292@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