mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
memcg: show reclaim stat
Add the following four fields to memory.stat file: - inactive_ratio - recent_rotated_anon - recent_rotated_file - recent_scanned_anon - recent_scanned_file Acked-by: Rik van Riel <[email protected]> Signed-off-by: KAMEZAWA Hiroyuki <[email protected]> Signed-off-by: KOSAKI Motohiro <[email protected]> Cc: Balbir Singh <[email protected]> Cc: Daisuke Nishimura <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
9439c1c95b
commit
7f016ee8b6
2 changed files with 55 additions and 0 deletions
|
|
@ -1816,6 +1816,36 @@ static int mem_control_stat_show(struct cgroup *cont, struct cftype *cft,
|
|||
cb->fill(cb, "unevictable", unevictable * PAGE_SIZE);
|
||||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_VM
|
||||
cb->fill(cb, "inactive_ratio", mem_cont->inactive_ratio);
|
||||
|
||||
{
|
||||
int nid, zid;
|
||||
struct mem_cgroup_per_zone *mz;
|
||||
unsigned long recent_rotated[2] = {0, 0};
|
||||
unsigned long recent_scanned[2] = {0, 0};
|
||||
|
||||
for_each_online_node(nid)
|
||||
for (zid = 0; zid < MAX_NR_ZONES; zid++) {
|
||||
mz = mem_cgroup_zoneinfo(mem_cont, nid, zid);
|
||||
|
||||
recent_rotated[0] +=
|
||||
mz->reclaim_stat.recent_rotated[0];
|
||||
recent_rotated[1] +=
|
||||
mz->reclaim_stat.recent_rotated[1];
|
||||
recent_scanned[0] +=
|
||||
mz->reclaim_stat.recent_scanned[0];
|
||||
recent_scanned[1] +=
|
||||
mz->reclaim_stat.recent_scanned[1];
|
||||
}
|
||||
cb->fill(cb, "recent_rotated_anon", recent_rotated[0]);
|
||||
cb->fill(cb, "recent_rotated_file", recent_rotated[1]);
|
||||
cb->fill(cb, "recent_scanned_anon", recent_scanned[0]);
|
||||
cb->fill(cb, "recent_scanned_file", recent_scanned[1]);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue