Skip to content

Commit

Permalink
vmscan: kswapd: don't retry balance_pgdat() if all zones are unreclai…
Browse files Browse the repository at this point in the history
…mable

Commit f50de2d (vmscan: have kswapd sleep for a short interval and double
check it should be asleep) can cause kswapd to enter an infinite loop if
running on a single-CPU system.  If all zones are unreclaimble,
sleeping_prematurely return 1 and kswapd will call balance_pgdat() again.
but it's totally meaningless, balance_pgdat() doesn't anything against
unreclaimable zone!

Signed-off-by: KOSAKI Motohiro <[email protected]>
Cc: Mel Gorman <[email protected]>
Reported-by: Will Newton <[email protected]>
Reviewed-by: Minchan Kim <[email protected]>
Reviewed-by: Rik van Riel <[email protected]>
Tested-by: Will Newton <[email protected]>
Reviewed-by: Wu Fengguang <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
kosaki authored and torvalds committed Jan 16, 2010
1 parent af2422c commit de3fab3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1922,6 +1922,9 @@ static int sleeping_prematurely(pg_data_t *pgdat, int order, long remaining)
if (!populated_zone(zone))
continue;

if (zone_is_all_unreclaimable(zone))
continue;

if (!zone_watermark_ok(zone, order, high_wmark_pages(zone),
0, 0))
return 1;
Expand Down

0 comments on commit de3fab3

Please sign in to comment.