mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
mm: remove reclaim and compaction retry approximations
If per-zone LRU accounting is available then there is no point approximating whether reclaim and compaction should retry based on pgdat statistics. This is effectively a revert of "mm, vmstat: remove zone and node double accounting by approximating retries" with the difference that inactive/active stats are still available. This preserves the history of why the approximation was retried and why it had to be reverted to handle OOM kills on 32-bit systems. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Mel Gorman <[email protected]> Acked-by: Johannes Weiner <[email protected]> Acked-by: Minchan Kim <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Vlastimil Babka <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
bb4cc2bea6
commit
5a1c84b404
8 changed files with 39 additions and 58 deletions
18
mm/vmscan.c
18
mm/vmscan.c
|
|
@ -194,6 +194,24 @@ static bool sane_reclaim(struct scan_control *sc)
|
|||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This misses isolated pages which are not accounted for to save counters.
|
||||
* As the data only determines if reclaim or compaction continues, it is
|
||||
* not expected that isolated pages will be a dominating factor.
|
||||
*/
|
||||
unsigned long zone_reclaimable_pages(struct zone *zone)
|
||||
{
|
||||
unsigned long nr;
|
||||
|
||||
nr = zone_page_state_snapshot(zone, NR_ZONE_INACTIVE_FILE) +
|
||||
zone_page_state_snapshot(zone, NR_ZONE_ACTIVE_FILE);
|
||||
if (get_nr_swap_pages() > 0)
|
||||
nr += zone_page_state_snapshot(zone, NR_ZONE_INACTIVE_ANON) +
|
||||
zone_page_state_snapshot(zone, NR_ZONE_ACTIVE_ANON);
|
||||
|
||||
return nr;
|
||||
}
|
||||
|
||||
unsigned long pgdat_reclaimable_pages(struct pglist_data *pgdat)
|
||||
{
|
||||
unsigned long nr;
|
||||
|
|
|
|||
Loading…
Reference in a new issue