linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* vmscan: Do not run shrinkers for zones other than ZONE_NORMAL
@ 2010-10-21 17:59 Christoph Lameter
  2010-10-21 18:00 ` shrinkers: Add node to indicate where to target shrinking Christoph Lameter
                   ` (4 more replies)
  0 siblings, 5 replies; 45+ messages in thread
From: Christoph Lameter @ 2010-10-21 17:59 UTC (permalink / raw)
  To: akpm; +Cc: npiggin, Pekka Enberg, David Rientjes, linux-mm, Andi Kleen

Slab objects (and other caches) are always allocated from ZONE_NORMAL.
Not from any other zone. Calling the shrinkers for those zones may put
unnecessary pressure on the caches.

Check the zone if we are in a reclaim situation where we are targeting
a specific node. Can occur f.e. in kswapd and in zone reclaim.

Signed-off-by: Christoph Lameter <cl@linux.com>

---
 mm/vmscan.c |   19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

Index: linux-2.6/mm/vmscan.c
===================================================================
--- linux-2.6.orig/mm/vmscan.c	2010-10-21 12:26:17.000000000 -0500
+++ linux-2.6/mm/vmscan.c	2010-10-21 12:33:56.000000000 -0500
@@ -2218,15 +2218,21 @@ loop_again:
 			if (!zone_watermark_ok(zone, order,
 					8*high_wmark_pages(zone), end_zone, 0))
 				shrink_zone(priority, zone, &sc);
-			reclaim_state->reclaimed_slab = 0;
-			nr_slab = shrink_slab(sc.nr_scanned, GFP_KERNEL,
-						lru_pages);
-			sc.nr_reclaimed += reclaim_state->reclaimed_slab;
-			total_scanned += sc.nr_scanned;
+
+			if (zone_idx(zone) == ZONE_NORMAL) {
+				reclaim_state->reclaimed_slab = 0;
+				nr_slab = shrink_slab(sc.nr_scanned, GFP_KERNEL,
+							lru_pages);
+				sc.nr_reclaimed += reclaim_state->reclaimed_slab;
+				total_scanned += sc.nr_scanned;
+			} else
+				nr_slab = 0;
+
 			if (zone->all_unreclaimable)
 				continue;
 			if (nr_slab == 0 && !zone_reclaimable(zone))
 				zone->all_unreclaimable = 1;
+
 			/*
 			 * If we've done a decent amount of scanning and
 			 * the reclaim ratio is low, start doing writepage
@@ -2697,7 +2703,8 @@ static int __zone_reclaim(struct zone *z
 	}

 	nr_slab_pages0 = zone_page_state(zone, NR_SLAB_RECLAIMABLE);
-	if (nr_slab_pages0 > zone->min_slab_pages) {
+	if (nr_slab_pages0 > zone->min_slab_pages &&
+					zone_idx(zone) == ZONE_NORMAL) {
 		/*
 		 * shrink_slab() does not currently allow us to determine how
 		 * many pages were freed in this zone. So we take the current

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2010-11-15  0:29 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-21 17:59 vmscan: Do not run shrinkers for zones other than ZONE_NORMAL Christoph Lameter
2010-10-21 18:00 ` shrinkers: Add node to indicate where to target shrinking Christoph Lameter
2010-10-21 18:12   ` Andi Kleen
2010-10-21 20:57   ` David Rientjes
2010-10-21 21:07     ` Christoph Lameter
2010-10-22 13:27     ` Andi Kleen
2010-10-21 23:58   ` Nick Piggin
2010-10-22 12:12     ` Andi Kleen
2010-10-22 15:55     ` Christoph Hellwig
2010-10-22 16:32       ` Christoph Lameter
2010-10-24  1:42         ` Nick Piggin
2010-10-25  0:57           ` KOSAKI Motohiro
2010-10-25 14:59           ` Christoph Lameter
2010-11-09  4:03             ` Nick Piggin
2010-10-22 16:46       ` Andi Kleen
2010-10-24  1:31       ` Nick Piggin
2010-11-14  2:26   ` Michel Lespinasse
2010-11-14  7:10     ` KOSAKI Motohiro
2010-11-14 11:05       ` Michel Lespinasse
2010-11-15  0:29         ` KOSAKI Motohiro
2010-10-21 18:13 ` vmscan: Do not run shrinkers for zones other than ZONE_NORMAL Andi Kleen
2010-10-21 18:22   ` Christoph Lameter
2010-10-21 18:27   ` Christoph Lameter
2010-10-21 18:33     ` Andi Kleen
2010-10-21 20:48     ` David Rientjes
2010-10-21 20:54       ` Christoph Lameter
2010-10-21 19:40 ` Andrew Morton
2010-10-21 20:03   ` Christoph Lameter
2010-10-21 20:14     ` Andrew Morton
2010-10-21 20:28       ` Christoph Lameter
2010-10-21 20:36         ` Andrew Morton
2010-10-21 20:49           ` Christoph Lameter
2010-10-21 20:59             ` Andrew Morton
2010-10-21 21:13               ` Christoph Lameter
2010-10-21 21:21                 ` Andrew Morton
2010-10-21 23:04                   ` Christoph Lameter
2010-10-21 23:56 ` Nick Piggin
2010-10-22  1:37 ` KOSAKI Motohiro
2010-10-22 14:06   ` Christoph Lameter
2010-10-24  1:37     ` Nick Piggin
2010-10-25  1:22     ` KOSAKI Motohiro
2010-10-25 15:07       ` Christoph Lameter
2010-10-26  2:52         ` KOSAKI Motohiro
2010-10-26 12:42           ` KOSAKI Motohiro
2010-10-26 13:10           ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).