From: Kirill Korotaev Date: Sun, 8 Jan 2006 09:01:05 +0000 (-0800) Subject: [PATCH] Optimise oom kill of current task X-Git-Tag: v2.6.16-rc1~874 X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=2f659f462d2ab519068d0e2bb677d7a700decb8d;p=powerpc.git [PATCH] Optimise oom kill of current task When oom_killer kills current there's no need to call schedule_timeout_interruptible() since task must die ASAP. Signed-Off-By: Pavel Emelianov Signed-Off-By: Kirill Korotaev Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/oom_kill.c b/mm/oom_kill.c index d348b90359..4748b906af 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -298,7 +298,8 @@ retry: /* * Give "p" a good chance of killing itself before we - * retry to allocate memory. + * retry to allocate memory unless "p" is current */ - schedule_timeout_interruptible(1); + if (!test_thread_flag(TIF_MEMDIE)) + schedule_timeout_interruptible(1); }