[PATCH 08 of 13] stop useless vm trashing while we wait the TIF_MEMDIE task to exit

Andrea Arcangeli
2008-01-08T07:50:39Z

# Date 1199470022 -3600
# Node ID be951f4c07326327719ad105f14be41296fcf753
# Parent ee9691f08d054949b7718cff94c4f132d97626de
stop useless vm trashing while we wait the TIF_MEMDIE task to exit

There's no point in trying to free memory if we're oom.

Signed-off-by: Andrea Arcangeli <andrea@suse.de>

diff --git a/mm/vmscan.c b/mm/vmscan.c
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1129,6 +1129,13 @@ static unsigned long shrink_zone(int pri
nr_inactive = 0;

while (nr_active || nr_inactive) {
+ if (unlikely(zone_is_oom_locked(zone))) {
+ if (!test_thread_flag(TIF_MEMDIE))
+ /* get out of the way */
+ schedule_timeout_interruptible(1);
+ else
+ break;
+ }
if (nr_active) {
nr_to_scan = min(nr_active,
(unsigned long)sc->swap_cluster_max);