vmscan: check high watermark after shrink zone
Kswapd checks that zone has sufficient pages free via zone_watermark_ok(). If any zone doesn't have enough pages, we set all_zones_ok to zero. !all_zone_ok makes kswapd retry rather than sleeping. I think the watermark check before shrink_zone() is pointless. Only after kswapd has tried to shrink the zone is the check meaningful. Move the check to after the call to shrink_zone(). [akpm@linux-foundation.org: fix comment, layout] Signed-off-by: Minchan Kim <minchan.kim@gmail.com> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Rik van Riel <riel@redhat.com> Reviewed-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
59e99e5b97
commit
45973d74fd
22
mm/vmscan.c
22
mm/vmscan.c
@@ -2060,9 +2060,6 @@ loop_again:
|
|||||||
priority != DEF_PRIORITY)
|
priority != DEF_PRIORITY)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!zone_watermark_ok(zone, order,
|
|
||||||
high_wmark_pages(zone), end_zone, 0))
|
|
||||||
all_zones_ok = 0;
|
|
||||||
temp_priority[i] = priority;
|
temp_priority[i] = priority;
|
||||||
sc.nr_scanned = 0;
|
sc.nr_scanned = 0;
|
||||||
note_zone_scanning_priority(zone, priority);
|
note_zone_scanning_priority(zone, priority);
|
||||||
@@ -2102,13 +2099,18 @@ loop_again:
|
|||||||
total_scanned > sc.nr_reclaimed + sc.nr_reclaimed / 2)
|
total_scanned > sc.nr_reclaimed + sc.nr_reclaimed / 2)
|
||||||
sc.may_writepage = 1;
|
sc.may_writepage = 1;
|
||||||
|
|
||||||
/*
|
if (!zone_watermark_ok(zone, order,
|
||||||
* We are still under min water mark. it mean we have
|
high_wmark_pages(zone), end_zone, 0)) {
|
||||||
* GFP_ATOMIC allocation failure risk. Hurry up!
|
all_zones_ok = 0;
|
||||||
*/
|
/*
|
||||||
if (!zone_watermark_ok(zone, order, min_wmark_pages(zone),
|
* We are still under min water mark. This
|
||||||
end_zone, 0))
|
* means that we have a GFP_ATOMIC allocation
|
||||||
has_under_min_watermark_zone = 1;
|
* failure risk. Hurry up!
|
||||||
|
*/
|
||||||
|
if (!zone_watermark_ok(zone, order,
|
||||||
|
min_wmark_pages(zone), end_zone, 0))
|
||||||
|
has_under_min_watermark_zone = 1;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (all_zones_ok)
|
if (all_zones_ok)
|
||||||
|
Reference in New Issue
Block a user