From: Andrea Arcangeli <andrea@cpushare.com>
To: David Rientjes <rientjes@google.com>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 04 of 11] avoid selecting already killed tasks
Date: Thu, 3 Jan 2008 20:54:33 +0100 [thread overview]
Message-ID: <20080103195433.GW30939@v2.random> (raw)
In-Reply-To: <alpine.DEB.0.9999.0801031036110.27032@chino.kir.corp.google.com>
On Thu, Jan 03, 2008 at 10:47:33AM -0800, David Rientjes wrote:
> Traditionally we've only allowed one thread in the entire system to have
> TIF_MEMDIE at a time because as you give access to memory reserves to more
> threads it becomes less of a help to exiting tasks. So by OOM killing a
> sibling or parent you could be taking away more memory from the exiting
> task; hopefully it won't be noticeable and the sibling or parent will
> quickly exit.
In theory no memory allocation should be required in do_exit.... in
practice sometime it can happen, but the PF_MEMALLOC pool is available
and can be emptied way before the first task has been killed, and the
potential eaters of the PF_MEMALLOC pool are much heavier users than
the do_exit path, so I doubt worrying about the memory reserves by the
time TIF_MEMDIE has been set is a valid concern.
> Perhaps instead of killing additional tasks, we should only make the
> exemption if a TIF_MEMDIE task is TASK_UNINTERRUPTIBLE during the
> select_bad_process() scan. I haven't personally witnessed any blocking in
> the exit path of an OOM killed task that doesn't leave it in D state and
> prevents it from dying.
Initially I did this. But there are places where the task is
INTERRUPTIBLE too (like the ones I introduced). I felt it a bit weak.
> The 60-second (or whatever time limit) timeout would almost certainly
> always target tasks stuck in D state. Those tasks will probably never
yes.
> exit if the timeout expires no matter how many times it is OOM killed. So
yes.
> the best alternative is to then take TIF_MEMDIE away from that task,
> reduce its timeslice, and never select it again for OOM kill.
The TIF_MEMDIE undoing isn't a big deal. Sigkilling undoing is more
interesting.
> If you agree with me that an addition to struct task_struct to keep the
> jiffies of the time it received TIF_MEMDIE is beneficial then it will
> obsolete this patch.
I tried to prioritize and reduce and simplify the amount of stuff to
push to the minimum to be stable, but certainly I'd like to take the
more complex approach too, yet I'd keep it at the end to keep the
priority high on preventing the crash with small changes. I was being
more complex originally with a global timeout, still simpler than your
per-task timeout, and yet it wasn't merged as style changes
to such code bitrotten the patchset I guess.
> The zone-oom-lock wasn't intended to necessarily prevent subsequent OOM
> kills of tasks, it was intended to serialize the OOM killer so that
> multiple entrants will not be killing additional tasks when one would have
> sufficed.
I know. I introduced the semaphore myself for this reason. But I also
had additional feedback coming from do_exit which is missing now...
> It was made on a per-zone level instead of a global level, as your
> approach did, to support cpusets and memory policy OOM killings. With a
> global approach these OOM kills would have taken longer because you were
> serializing globally and the OOM killer was dealing with a zonelist that
> wouldn't necessarily have alleviated OOM conditions in other zones.
I know, scaling oom killing in parallel in numa is nicer but in
practice oom is rare and should never happen... so my global approach
wasn't that different ;)
--
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:[~2008-01-03 19:54 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-03 2:09 [PATCH 00 of 11] oom deadlock fixes Andrea Arcangeli
2008-01-03 2:09 ` [PATCH 01 of 11] limit shrink zone scanning Andrea Arcangeli
2008-01-07 19:11 ` Christoph Lameter
2008-01-03 2:09 ` [PATCH 02 of 11] avoid oom deadlock in nfs_create_request Andrea Arcangeli
2008-01-07 19:13 ` Christoph Lameter
2008-01-03 2:09 ` [PATCH 03 of 11] prevent oom deadlocks during read/write operations Andrea Arcangeli
2008-01-07 19:15 ` Christoph Lameter
2008-01-07 19:26 ` Andrea Arcangeli
2008-01-03 2:09 ` [PATCH 04 of 11] avoid selecting already killed tasks Andrea Arcangeli
2008-01-03 9:40 ` David Rientjes
2008-01-03 13:41 ` Andrea Arcangeli
2008-01-03 18:47 ` David Rientjes
2008-01-03 19:54 ` Andrea Arcangeli [this message]
2008-01-03 20:49 ` David Rientjes
2008-01-07 19:17 ` Christoph Lameter
2008-01-03 2:09 ` [PATCH 05 of 11] reduce the probability of an OOM livelock Andrea Arcangeli
2008-01-07 19:32 ` Christoph Lameter
2008-01-03 2:09 ` [PATCH 06 of 11] balance_pgdat doesn't return the number of pages freed Andrea Arcangeli
2008-01-07 19:33 ` Christoph Lameter
2008-01-03 2:09 ` [PATCH 07 of 11] don't depend on PF_EXITING tasks to go away Andrea Arcangeli
2008-01-03 9:52 ` David Rientjes
2008-01-03 13:29 ` Andrea Arcangeli
2008-01-03 2:09 ` [PATCH 08 of 11] stop useless vm trashing while we wait the TIF_MEMDIE task to exit Andrea Arcangeli
2008-01-03 2:09 ` [PATCH 09 of 11] oom select should only take rss into account Andrea Arcangeli
2008-01-07 19:35 ` Christoph Lameter
2008-01-03 2:09 ` [PATCH 10 of 11] limit reclaim if enough pages have been freed Andrea Arcangeli
2008-01-07 19:37 ` Christoph Lameter
2008-01-08 7:28 ` Andrea Arcangeli
2008-01-03 2:09 ` [PATCH 11 of 11] not-wait-memdie Andrea Arcangeli
2008-01-03 9:55 ` David Rientjes
2008-01-03 13:06 ` Andrea Arcangeli
2008-01-03 18:54 ` David Rientjes
2008-01-07 19:43 ` Christoph Lameter
2008-01-08 1:57 ` David Rientjes
2008-01-08 3:25 ` Nick Piggin
2008-01-08 3:37 ` David Rientjes
2008-01-08 7:42 ` Nick Piggin
2008-01-08 7:45 ` Andrea Arcangeli
2008-01-08 7:37 ` Andrea Arcangeli
2008-01-08 7:31 ` Andrea Arcangeli
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=20080103195433.GW30939@v2.random \
--to=andrea@cpushare.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--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