Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 2181

kernel-2.6.18-238.el5.src.rpm

From: Larry Woodman <lwoodman@redhat.com>
Date: Fri, 5 Dec 2008 11:40:02 -0500
Subject: [mm] decrement reclaim_in_progress after an OOM kill
Message-id: 1228495202.14346.25.camel@localhost.localdomain
O-Subject: [RHEL5-U4 patch] decrement zone->reclaim_in_progress when a process is OOM killed while directly reclaiming memory.
Bugzilla: 488955
RH-Acked-by: Rik van Riel <riel@redhat.com>
RH-Acked-by: Alan Cox <alan@redhat.com>

In RHEL5-U2 we took in an upstream patch to force a process to bail out
of the direct memory reclaim code if it gets OOM killed.  This patch was
missing a decrement of the zone->reclaim_in_progress if the OOM kill
occurred while in shrink_zone().

This is not important enough to include in RHEL5-U3 because
reclaim_in_progress is only used when zone_reclaim_mode is set and it is
not set by default.

diff --git a/mm/vmscan.c b/mm/vmscan.c
index ea3b83d..de11faa 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -906,8 +906,10 @@ static unsigned long shrink_zone(int priority, struct zone *zone,
 		nr_inactive = 0;
 
 	while (nr_active || nr_inactive) {
-		if (test_thread_flag(TIF_MEMDIE))
+		if (test_thread_flag(TIF_MEMDIE)) {
+			atomic_dec(&zone->reclaim_in_progress);
 			return 0;
+		}
 		if (nr_active) {
 			nr_to_scan = min(nr_active,
 					(unsigned long)sc->swap_cluster_max);