From 3b002e699453c5897e455b9e052a96e3f2c68af0 Mon Sep 17 00:00:00 2001 From: Zlatko Calusic Date: Fri, 22 Feb 2013 16:32:34 -0800 Subject: [PATCH] --- yaml --- r: 356500 b: refs/heads/master c: dafcb73e385e39b9a7ebd5c4ecbc4ae921862eb9 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/mm/vmscan.c | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index e46aafec5cdb..39ffc080c8a2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7103f16dbff20fa969c9500902d980d17f953fa6 +refs/heads/master: dafcb73e385e39b9a7ebd5c4ecbc4ae921862eb9 diff --git a/trunk/mm/vmscan.c b/trunk/mm/vmscan.c index 463990941a78..4093b99044f6 100644 --- a/trunk/mm/vmscan.c +++ b/trunk/mm/vmscan.c @@ -2616,6 +2616,7 @@ static bool prepare_kswapd_sleep(pg_data_t *pgdat, int order, long remaining, static unsigned long balance_pgdat(pg_data_t *pgdat, int order, int *classzone_idx) { + bool pgdat_is_balanced = false; struct zone *unbalanced_zone; int i; int end_zone = 0; /* Inclusive. 0 = ZONE_DMA */ @@ -2690,8 +2691,11 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order, zone_clear_flag(zone, ZONE_CONGESTED); } } - if (i < 0) + + if (i < 0) { + pgdat_is_balanced = true; goto out; + } for (i = 0; i <= end_zone; i++) { struct zone *zone = pgdat->node_zones + i; @@ -2818,8 +2822,11 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order, pfmemalloc_watermark_ok(pgdat)) wake_up(&pgdat->pfmemalloc_wait); - if (pgdat_balanced(pgdat, order, *classzone_idx)) + if (pgdat_balanced(pgdat, order, *classzone_idx)) { + pgdat_is_balanced = true; break; /* kswapd: all done */ + } + /* * OK, kswapd is getting into trouble. Take a nap, then take * another pass across the zones. @@ -2840,9 +2847,9 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order, if (sc.nr_reclaimed >= SWAP_CLUSTER_MAX) break; } while (--sc.priority >= 0); -out: - if (!pgdat_balanced(pgdat, order, *classzone_idx)) { +out: + if (!pgdat_is_balanced) { cond_resched(); try_to_freeze();