Skip to content

Commit

Permalink
[PATCH] Optimise oom kill of current task
Browse files Browse the repository at this point in the history
When oom_killer kills current there's no need to call
schedule_timeout_interruptible() since task must die ASAP.

Signed-Off-By: Pavel Emelianov <xemul@sw.ru>
Signed-Off-By: Kirill Korotaev <dev@openvz.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Kirill Korotaev authored and Linus Torvalds committed Jan 9, 2006
1 parent 6ce3c4c commit 2f659f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ void out_of_memory(gfp_t gfp_mask, int order)

/*
* 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);
}

0 comments on commit 2f659f4

Please sign in to comment.