+ fix-bug-in-try_to_free_pages-and-balance_pgdat-when-they.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     Fix bug in try_to_free_pages and balance_pgdat when they fail to reclaim pages

has been added to the -mm tree.  Its filename is

     fix-bug-in-try_to_free_pages-and-balance_pgdat-when-they.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: Fix bug in try_to_free_pages and balance_pgdat when they fail to reclaim pages
From: Martin Bligh <mbligh@xxxxxxxxxx>

The same bug is contained in both try_to_free_pages and balance_pgdat.  On
reclaiming the requisite number of pages we correctly set prev_priority
back to DEF_PRIORITY.  However, we ALSO do this even if we loop over all
priorities and fail to reclaim.

Setting prev_priority artificially high causes reclaimers to set distress
artificially low, and fail to reclaim mapped pages, when they are, in fact,
under severe memory pressure (their priority may be as low as 0).  This
causes the OOM killer to fire incorrectly.

This patch changes that to set prev_priority to 0 instead, if we fail to
reclaim.

Signed-off-by: Martin J. Bligh <mbligh@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 mm/vmscan.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff -puN mm/vmscan.c~fix-bug-in-try_to_free_pages-and-balance_pgdat-when-they mm/vmscan.c
--- a/mm/vmscan.c~fix-bug-in-try_to_free_pages-and-balance_pgdat-when-they
+++ a/mm/vmscan.c
@@ -1071,7 +1071,10 @@ out:
 		if (!cpuset_zone_allowed(zone, __GFP_HARDWALL))
 			continue;
 
-		zone->prev_priority = zone->temp_priority;
+		if (priority < 0)		/* we failed to reclaim */
+			zone->prev_priority = 0;
+		else
+			zone->prev_priority = zone->temp_priority;
 	}
 	return ret;
 }
@@ -1229,7 +1232,10 @@ out:
 	for (i = 0; i < pgdat->nr_zones; i++) {
 		struct zone *zone = pgdat->node_zones + i;
 
-		zone->prev_priority = zone->temp_priority;
+		if (priority < 0)		/* we failed to reclaim */
+			zone->prev_priority = 0;
+		else
+			zone->prev_priority = zone->temp_priority;
 	}
 	if (!all_zones_ok) {
 		cond_resched();
_

Patches currently in -mm which might be from mbligh@xxxxxxxxxx are

posix-cpu-timers-prevent-signal-delivery-starvation.patch
fix-up-a-multitude-of-acpi-compiler-warnings-on-x86_64.patch
fix-bug-in-try_to_free_pages-and-balance_pgdat-when-they.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux