[PATCH 20/27] mm, vmscan: Update classzone_idx if buffer_heads_over_limit

From: Mel Gorman
Date: Wed Apr 06 2016 - 07:21:53 EST


If buffer heads are over the limit then the direct reclaim gfp_mask
is promoted to __GFP_HIGHMEM so that lowmem is indirectly freed. With
node-based reclaim, it is also required that the classzone_idx be updated
or the pages will be skipped.

Signed-off-by: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx>
---
mm/vmscan.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 2f2072bc6884..0298c0977eac 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2575,8 +2575,10 @@ static bool shrink_zones(struct zonelist *zonelist, struct scan_control *sc,
* highmem pages could be pinning lowmem pages storing buffer_heads
*/
orig_mask = sc->gfp_mask;
- if (buffer_heads_over_limit)
+ if (buffer_heads_over_limit) {
sc->gfp_mask |= __GFP_HIGHMEM;
+ classzone_idx = gfp_zone(sc->gfp_mask);
+ }

for_each_zone_zonelist_nodemask(zone, z, zonelist,
classzone_idx, sc->nodemask) {
--
2.6.4