mm, vmscan: cleanup lru size claculations
Subsystems (4)
[email protected]
maintainerPATCH 124/142 mm, vmscan: cleanup lru size claculations
From: Michal Hocko <[email protected]>
Subject: mm, vmscan: cleanup lru size claculations
lruvec_lru_size returns the full size of the LRU list while we sometimes need a value reduced only to eligible zones (e.g. for lowmem requests). inactive_list_is_low is one such user. Later patches will add more of them. Add a new parameter to lruvec_lru_size and allow it filter out zones which are not eligible for the given context.
Signed-off-by Michal Hocko <[email protected]>
Acked-by Johannes Weiner <[email protected]>
Acked-by Hillf Danton <[email protected]>
Acked-by Minchan Kim <[email protected]>
Acked-by Mel Gorman <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
include/linux/mmzone.h | 2 mm/vmscan.c | 89 +++++++++++++++++++-------------------- mm/workingset.c | 2 3 files changed, 46 insertions(+), 47 deletions(-)
include/linux/mmzone.h renamed from include/linux/mmzone.h~mm-vmscan-cleanup-lru-size-claculations +1 -1
@@ -779,7 +779,7 @@ static inline struct pglist_data *lruvec#endif } -extern unsigned long lruvec_lru_size (struct lruvec *lruvec,enum lru_list lru); +extern unsigned long lruvec_lru_size (struct lruvec *lruvec,enum lru_list lru,int zone_idx);#ifdef CONFIG_HAVE_MEMORY_PRESENT void memory_present (int nid,unsigned long start,unsigned long end);
mm/vmscan.c renamed from mm/vmscan.c~mm-vmscan-cleanup-lru-size-claculations +44 -45
138 lines not on this page · raw message
mm/workingset.c renamed from mm/workingset.c~mm-vmscan-cleanup-lru-size-claculations +1 -1
@@ -267,7 +267,7 @@ bool workingset_refault(void *shadow) } lruvec =mem_cgroup_lruvec (pgdat, memcg); refault =atomic_long_read (&lruvec->inactive_age); - active_file =lruvec_lru_size (lruvec,LRU_ACTIVE_FILE ); + active_file =lruvec_lru_size (lruvec,LRU_ACTIVE_FILE ,MAX_NR_ZONES );rcu_read_unlock ();/*
_