From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752417AbYK3LDT (ORCPT ); Sun, 30 Nov 2008 06:03:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751273AbYK3LDH (ORCPT ); Sun, 30 Nov 2008 06:03:07 -0500 Received: from fgwnews.fujitsu.co.jp ([164.71.1.134]:36726 "EHLO fgwnews.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751263AbYK3LDG (ORCPT ); Sun, 30 Nov 2008 06:03:06 -0500 From: KOSAKI Motohiro To: LKML , linux-mm , Andrew Morton , Balbir Singh , KAMEZAWA Hiroyuki , Rik van Riel Subject: [PATCH 09/09] memcg: show reclaim stat Cc: kosaki.motohiro@jp.fujitsu.com In-Reply-To: <20081130193502.8145.KOSAKI.MOTOHIRO@jp.fujitsu.com> References: <20081130193502.8145.KOSAKI.MOTOHIRO@jp.fujitsu.com> Message-Id: <20081130200223.8160.KOSAKI.MOTOHIRO@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.42 [ja] Date: Sun, 30 Nov 2008 20:03:00 +0900 (JST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org added following four field to memory.stat file. - recent_rotated_anon - recent_rotated_file - recent_scanned_anon - recent_scanned_file Signed-off-by: KOSAKI Motohiro --- mm/memcontrol.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) Index: b/mm/memcontrol.c =================================================================== --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1787,6 +1787,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; }