From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Andrew Morton <akpm@osdl.org>
Cc: Nick Piggin <npiggin@suse.de>,
Linux Memory Management <linux-mm@kvack.org>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [patch 3/5] oom: less memdie
Date: Fri, 13 Oct 2006 16:38:22 +1000 [thread overview]
Message-ID: <452F345E.3000301@yahoo.com.au> (raw)
In-Reply-To: <20061012150350.00f19d2a.akpm@osdl.org>
Andrew Morton wrote:
>On Thu, 12 Oct 2006 16:10:01 +0200 (CEST)
>Nick Piggin <npiggin@suse.de> wrote:
>
>
>>Don't cause all threads in all other thread groups to gain TIF_MEMDIE
>>otherwise we'll get a thundering herd eating out memory reserve. This
>>may not be the optimal scheme, but it fits our policy of allowing just
>>one TIF_MEMDIE in the system at once.
>>
>>Signed-off-by: Nick Piggin <npiggin@suse.de>
>>
>>Index: linux-2.6/mm/oom_kill.c
>>===================================================================
>>--- linux-2.6.orig/mm/oom_kill.c
>>+++ linux-2.6/mm/oom_kill.c
>>@@ -322,11 +322,12 @@ static int oom_kill_task(struct task_str
>>
>> /*
>> * kill all processes that share the ->mm (i.e. all threads),
>>- * but are in a different thread group.
>>+ * but are in a different thread group. Don't let them have access
>>+ * to memory reserves though, otherwise we might deplete all memory.
>> */
>> do_each_thread(g, q) {
>> if (q->mm == mm && q->tgid != p->tgid)
>>- __oom_kill_task(q, 1);
>>+ force_sig(SIGKILL, p);
>> } while_each_thread(g, q);
>>
>>
>
>Curious. How much testing did you do of this stuff? I assume there were
>some observed problems. What were they, and what was the observed effect
>of these changes?
>
This change I actually didn't really test because I don't have any apps
to speak
of which use multiple thread groups.
I stumbled on it by inspection when trying to fix the killing of
OOM_DISABLE tasks.
Basically -- we don't set TIF_MEMDIE or boost the priority of *any*
other thread in
our same group, so we shouldn't do it for *all* other threds of all
other groups.
Consider an OOM situation, where there will likely be a lot of threads
stuck in
__alloc_pages. If a large number of these suddenly get a big timeslice
and full
access to memory reserves, they'll eat into more than we'd like.
Now I'm not sure that our current OOM killing / memory reserving scheme is
perfect -- indeed if we only allow a single TIF_MEMDIE thread at once,
we can
get deadlocks. However, that's the direction we've chosen, and it seems
to work
reasonably well. Mostly.
This is just an enforcement of that policy rather than a change in
direction.
Criticism is always welcome though.
--
Send instant messages to your online friends http://au.messenger.yahoo.com
--
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:[~2006-10-13 6:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-12 14:09 [rfc][patch 0/5] 2.6.19-rc1: oom killer fixes Nick Piggin
2006-10-12 14:09 ` [patch 1/5] oom: don't kill unkillable children or siblings Nick Piggin
2006-10-12 22:00 ` Andrew Morton
2006-10-13 6:31 ` Nick Piggin
2006-10-12 14:09 ` [patch 2/5] oom: cleanup messages Nick Piggin
2006-10-12 14:10 ` [patch 3/5] oom: less memdie Nick Piggin
2006-10-12 22:03 ` Andrew Morton
2006-10-13 6:38 ` Nick Piggin [this message]
2006-10-12 14:10 ` [patch 4/5] mm: incorrect VM_FAULT_OOM returns from drivers Nick Piggin
2006-10-12 14:10 ` [patch 5/5] oom: invoke OOM killer from pagefault handler Nick Piggin
2006-10-12 15:12 ` Kirill Korotaev
2006-10-12 15:19 ` Nick Piggin
2006-10-12 22:09 ` Andrew Morton
2006-10-13 6:45 ` Nick Piggin
2006-10-13 6:47 ` Nick Piggin
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=452F345E.3000301@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@suse.de \
/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