From: Paul Menage <menage@google.com>
To: Rik van Riel <riel@redhat.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
rientjes@google.com, mel@csn.ul.ie, npiggin@suse.de
Subject: Re: [PATCH] copy over oom_adj value at fork time
Date: Thu, 16 Jul 2009 16:29:06 -0700 [thread overview]
Message-ID: <6599ad830907161629p54783716p7246e030b8da00fe@mail.gmail.com> (raw)
In-Reply-To: <6599ad830907141815x64e74a6ek1499f6032cea6f5@mail.gmail.com>
On Tue, Jul 14, 2009 at 6:15 PM, Paul Menage<menage@google.com> wrote:
>
> But ironically, with this fix applied the main part of the original
> change (force all threads in a process to share a single oom_adj
> value) will start to break my code - it's no longer possible to have
> the regular threads in a process be oom-immune, then vfork() and set a
> non-disabled oom_adj in the child, since this will set it for the
> entire process. (Our job scheduler does something like this, in order
> to have the launcher be OOM immune and the running jobs be at various
> oom_adj levels depending on their priority).
>
How about if instead of having the oom_adj be per-mm, we kept an array
of counters in the mm, tracking how many users were at each oom_adj
level; the OOM killer could then use the level of the mm's highest
oom_adj user when deciding how to calculate the badness of a thread
using that mm.
That would preserve the previous semantics of letting a spawned child
inherit a per-thread oom_adj value, while avoiding the specific
problem of the OOM killer getting livelocked (that David's patch
originally addressed) and the more general case of the inconsistency
in determining the oom_adj level of an mm depending on which thread
you look at.
For the very common case where all users of the mm are at the same
oom_adj level, this array could be left unallocated as NULL, and the
thread's own oom_adj used.
Paul
next prev parent reply other threads:[~2009-07-16 23:29 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200906020557.n525v6KO004302@imap1.linux-foundation.org>
2009-07-15 0:52 ` + oom-move-oom_adj-value-from-task_struct-to-mm_struct.patch added to -mm tree Paul Menage
2009-07-15 1:05 ` [PATCH] copy over oom_adj value at fork time Rik van Riel
2009-07-15 1:15 ` Paul Menage
2009-07-15 2:01 ` KOSAKI Motohiro
2009-07-15 2:12 ` [PATCH -mm] copy over oom_adj value at fork time (v2) Rik van Riel
2009-07-15 3:42 ` David Rientjes
2009-07-15 3:48 ` [PATCH] copy over oom_adj value at fork time David Rientjes
2009-07-16 23:29 ` Paul Menage [this message]
2009-07-17 9:34 ` David Rientjes
2009-07-17 20:03 ` Paul Menage
2009-07-17 23:12 ` David Rientjes
2009-07-20 21:52 ` Paul Menage
2009-07-21 3:40 ` David Rientjes
2009-07-21 7:19 ` KOSAKI Motohiro
2009-07-21 16:06 ` Paul Menage
2009-07-21 19:54 ` David Rientjes
2009-07-21 19:57 ` Paul Menage
2009-07-21 20:00 ` David Rientjes
2009-07-21 20:03 ` Paul Menage
2009-07-23 23:21 ` KOSAKI Motohiro
2009-07-23 23:29 ` David Rientjes
2009-07-24 1:10 ` KOSAKI Motohiro
2009-07-24 9:27 ` David Rientjes
2009-07-28 6:09 ` KOSAKI Motohiro
2009-07-28 6:14 ` David Rientjes
2009-07-15 1:49 ` KOSAKI Motohiro
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=6599ad830907161629p54783716p7246e030b8da00fe@mail.gmail.com \
--to=menage@google.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mel@csn.ul.ie \
--cc=npiggin@suse.de \
--cc=riel@redhat.com \
--cc=rientjes@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
all inboxes | Powered by JetHome®