mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
mm, vmscan: remove duplicate logic clearing node congestion and dirty state
Reclaim may stall if there is too much dirty or congested data on a node. This was previously based on zone flags and the logic for clearing the flags is in two places. As congestion/dirty tracking is now tracked on a per-node basis, we can remove some duplicate logic. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Mel Gorman <[email protected]> Acked-by: Hillf Danton <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Rik van Riel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
79dafcdca3
commit
6256c6b499
1 changed files with 12 additions and 12 deletions
24
mm/vmscan.c
24
mm/vmscan.c
|
|
@ -3008,7 +3008,17 @@ static bool zone_balanced(struct zone *zone, int order, int classzone_idx)
|
|||
{
|
||||
unsigned long mark = high_wmark_pages(zone);
|
||||
|
||||
return zone_watermark_ok_safe(zone, order, mark, classzone_idx);
|
||||
if (!zone_watermark_ok_safe(zone, order, mark, classzone_idx))
|
||||
return false;
|
||||
|
||||
/*
|
||||
* If any eligible zone is balanced then the node is not considered
|
||||
* to be congested or dirty
|
||||
*/
|
||||
clear_bit(PGDAT_CONGESTED, &zone->zone_pgdat->flags);
|
||||
clear_bit(PGDAT_DIRTY, &zone->zone_pgdat->flags);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -3154,13 +3164,6 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx)
|
|||
if (!zone_balanced(zone, order, 0)) {
|
||||
classzone_idx = i;
|
||||
break;
|
||||
} else {
|
||||
/*
|
||||
* If any eligible zone is balanced then the
|
||||
* node is not considered congested or dirty.
|
||||
*/
|
||||
clear_bit(PGDAT_CONGESTED, &zone->zone_pgdat->flags);
|
||||
clear_bit(PGDAT_DIRTY, &zone->zone_pgdat->flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3219,11 +3222,8 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx)
|
|||
if (!populated_zone(zone))
|
||||
continue;
|
||||
|
||||
if (zone_balanced(zone, sc.order, classzone_idx)) {
|
||||
clear_bit(PGDAT_CONGESTED, &pgdat->flags);
|
||||
clear_bit(PGDAT_DIRTY, &pgdat->flags);
|
||||
if (zone_balanced(zone, sc.order, classzone_idx))
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue