Re: [PATCH 11/11] memcg: show reclaim_stat

KAMEZAWA Hiroyuki
2008-12-02T09:06:59Z

On Mon, 1 Dec 2008 21:19:49 +0900 (JST)
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:

> added following four field to memory.stat file.
>
> - recent_rotated_anon
> - recent_rotated_file
> - recent_scanned_anon
> - recent_scanned_file
>
> it is useful for memcg reclaim debugging.
>
I'll put this under CONFIG_DEBUG_VM.

Thanks,
-Kame

>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> ---
> mm/memcontrol.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> Index: b/mm/memcontrol.c
> ===================================================================
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1799,6 +1799,31 @@ static int mem_control_stat_show(struct
>
> 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]);
> + }
> +
> return 0;
> }
>
>
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: email@kvack.org
>