Skip to contentSkip to conversation

mm, vmscan: cleanup lru size claculations

PATCH New [email protected] 1 participant 1 message Feb 22, 2017

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 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.

---

 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
diff -puN include/linux/mmzone.h~mm-vmscan-cleanup-lru-size-claculations include/linux/mmzone.h
@@ -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
diff -puN mm/workingset.c~mm-vmscan-cleanup-lru-size-claculations mm/workingset.c
@@ -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();
 
 	/*

_