aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/vmscan.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 828530e2794a..adc7e9058181 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2570,7 +2570,7 @@ static bool prepare_kswapd_sleep(pg_data_t *pgdat, int order, long remaining,
2570static unsigned long balance_pgdat(pg_data_t *pgdat, int order, 2570static unsigned long balance_pgdat(pg_data_t *pgdat, int order,
2571 int *classzone_idx) 2571 int *classzone_idx)
2572{ 2572{
2573 int all_zones_ok; 2573 struct zone *unbalanced_zone;
2574 unsigned long balanced; 2574 unsigned long balanced;
2575 int i; 2575 int i;
2576 int end_zone = 0; /* Inclusive. 0 = ZONE_DMA */ 2576 int end_zone = 0; /* Inclusive. 0 = ZONE_DMA */
@@ -2604,7 +2604,7 @@ loop_again:
2604 unsigned long lru_pages = 0; 2604 unsigned long lru_pages = 0;
2605 int has_under_min_watermark_zone = 0; 2605 int has_under_min_watermark_zone = 0;
2606 2606
2607 all_zones_ok = 1; 2607 unbalanced_zone = NULL;
2608 balanced = 0; 2608 balanced = 0;
2609 2609
2610 /* 2610 /*
@@ -2743,7 +2743,7 @@ loop_again:
2743 } 2743 }
2744 2744
2745 if (!zone_balanced(zone, testorder, 0, end_zone)) { 2745 if (!zone_balanced(zone, testorder, 0, end_zone)) {
2746 all_zones_ok = 0; 2746 unbalanced_zone = zone;
2747 /* 2747 /*
2748 * We are still under min water mark. This 2748 * We are still under min water mark. This
2749 * means that we have a GFP_ATOMIC allocation 2749 * means that we have a GFP_ATOMIC allocation
@@ -2776,7 +2776,7 @@ loop_again:
2776 pfmemalloc_watermark_ok(pgdat)) 2776 pfmemalloc_watermark_ok(pgdat))
2777 wake_up(&pgdat->pfmemalloc_wait); 2777 wake_up(&pgdat->pfmemalloc_wait);
2778 2778
2779 if (all_zones_ok || (order && pgdat_balanced(pgdat, balanced, *classzone_idx))) 2779 if (!unbalanced_zone || (order && pgdat_balanced(pgdat, balanced, *classzone_idx)))
2780 break; /* kswapd: all done */ 2780 break; /* kswapd: all done */
2781 /* 2781 /*
2782 * OK, kswapd is getting into trouble. Take a nap, then take 2782 * OK, kswapd is getting into trouble. Take a nap, then take
@@ -2786,7 +2786,7 @@ loop_again:
2786 if (has_under_min_watermark_zone) 2786 if (has_under_min_watermark_zone)
2787 count_vm_event(KSWAPD_SKIP_CONGESTION_WAIT); 2787 count_vm_event(KSWAPD_SKIP_CONGESTION_WAIT);
2788 else 2788 else
2789 congestion_wait(BLK_RW_ASYNC, HZ/10); 2789 wait_iff_congested(unbalanced_zone, BLK_RW_ASYNC, HZ/10);
2790 } 2790 }
2791 2791
2792 /* 2792 /*
@@ -2805,7 +2805,7 @@ out:
2805 * high-order: Balanced zones must make up at least 25% of the node 2805 * high-order: Balanced zones must make up at least 25% of the node
2806 * for the node to be balanced 2806 * for the node to be balanced
2807 */ 2807 */
2808 if (!(all_zones_ok || (order && pgdat_balanced(pgdat, balanced, *classzone_idx)))) { 2808 if (unbalanced_zone && (!order || !pgdat_balanced(pgdat, balanced, *classzone_idx))) {
2809 cond_resched(); 2809 cond_resched();
2810 2810
2811 try_to_freeze(); 2811 try_to_freeze();