lkml.org 
[lkml]   [2016]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm, vmscan: Make kswapd reclaim no more than needed
Date
We stop reclaiming pages if any eligible zone is balanced.

Signed-off-by: Hillf Danton <hillf.zj@alibaba-inc.com>
---

--- a/mm/vmscan.c Thu Jun 23 17:56:34 2016
+++ b/mm/vmscan.c Fri Jun 24 16:45:58 2016
@@ -3185,15 +3185,10 @@ static int balance_pgdat(pg_data_t *pgda
if (!populated_zone(zone))
continue;

- if (!zone_balanced(zone, sc.order, classzone_idx)) {
- classzone_idx = i;
- break;
- }
+ if (zone_balanced(zone, sc.order, classzone_idx))
+ goto out;
}

- if (i < 0)
- goto out;
-
/*
* Do some background aging of the anon list, to give
* pages a chance to be referenced before reclaiming. All
@@ -3236,19 +3231,6 @@ static int balance_pgdat(pg_data_t *pgda
/* Check if kswapd should be suspending */
if (try_to_freeze() || kthread_should_stop())
break;
-
- /*
- * Stop reclaiming if any eligible zone is balanced and clear
- * node writeback or congested.
- */
- for (i = 0; i <= classzone_idx; i++) {
- zone = pgdat->node_zones + i;
- if (!populated_zone(zone))
- continue;
-
- if (zone_balanced(zone, sc.order, classzone_idx))
- goto out;
- }

/*
* Raise priority if scanning rate is too low or there was no
--
\
 
 \ /
  Last update: 2016-06-24 11:41    [W:0.033 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site