From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: linux-mm@kvack.org,
"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
vgoyal@redhat.com, m-ikeda@ds.jp.nec.com, gthelen@google.com,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -mm 4/5] memcg generic file stat accounting interface.
Date: Tue, 3 Aug 2010 09:33:04 +0530 [thread overview]
Message-ID: <20100803040304.GG3863@balbir.in.ibm.com> (raw)
In-Reply-To: <20100802191715.63ce81ed.kamezawa.hiroyu@jp.fujitsu.com>
* KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2010-08-02 19:17:15]:
> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>
> Preparing for adding new status arounf file caches.(dirty, writeback,etc..)
> Using a unified macro and more generic names.
> All counters will have the same rule for updating.
>
> Changelog:
> - clean up and moved mem_cgroup_stat_index to header file.
>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> ---
> include/linux/memcontrol.h | 23 ++++++++++++++++++++++
> include/linux/page_cgroup.h | 12 +++++------
> mm/memcontrol.c | 46 ++++++++++++++++++--------------------------
> 3 files changed, 48 insertions(+), 33 deletions(-)
>
> Index: mmotm-0727/include/linux/memcontrol.h
> ===================================================================
> --- mmotm-0727.orig/include/linux/memcontrol.h
> +++ mmotm-0727/include/linux/memcontrol.h
> @@ -25,6 +25,29 @@ struct page_cgroup;
> struct page;
> struct mm_struct;
>
> +/*
> + * Per-cpu Statistics for memory cgroup.
> + */
> +enum mem_cgroup_stat_index {
> + /*
> + * For MEM_CONTAINER_TYPE_ALL, usage = pagecache + rss.
> + */
> + MEM_CGROUP_STAT_CACHE, /* # of pages charged as cache */
> + MEM_CGROUP_STAT_RSS, /* # of pages charged as anon rss */
> + MEM_CGROUP_STAT_PGPGIN_COUNT, /* # of pages paged in */
> + MEM_CGROUP_STAT_PGPGOUT_COUNT, /* # of pages paged out */
> + MEM_CGROUP_STAT_SWAPOUT, /* # of pages, swapped out */
> + MEM_CGROUP_EVENTS, /* incremented at every pagein/pageout */
> + MEM_CGROUP_ON_MOVE, /* A check for locking move account/status */
> + /* About file-stat please see memcontrol.h */
Isn't this memcontrol.h?
> + MEM_CGROUP_FSTAT_BASE,
> + MEM_CGROUP_FSTAT_FILE_MAPPED = MEM_CGROUP_FSTAT_BASE,
> + MEM_CGROUP_FSTAT_END,
> + MEM_CGROUP_STAT_NSTATS = MEM_CGROUP_FSTAT_END,
> +};
> +
> +#define MEMCG_FSTAT_IDX(idx) ((idx) - MEM_CGROUP_FSTAT_BASE)
> +
> extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
> struct list_head *dst,
> unsigned long *scanned, int order,
> Index: mmotm-0727/mm/memcontrol.c
> ===================================================================
> --- mmotm-0727.orig/mm/memcontrol.c
> +++ mmotm-0727/mm/memcontrol.c
> @@ -74,24 +74,6 @@ static int really_do_swap_account __init
> #define THRESHOLDS_EVENTS_THRESH (7) /* once in 128 */
> #define SOFTLIMIT_EVENTS_THRESH (10) /* once in 1024 */
>
> -/*
> - * Statistics for memory cgroup.
> - */
> -enum mem_cgroup_stat_index {
> - /*
> - * For MEM_CONTAINER_TYPE_ALL, usage = pagecache + rss.
> - */
> - MEM_CGROUP_STAT_CACHE, /* # of pages charged as cache */
> - MEM_CGROUP_STAT_RSS, /* # of pages charged as anon rss */
> - MEM_CGROUP_STAT_FILE_MAPPED, /* # of pages charged as file rss */
> - MEM_CGROUP_STAT_PGPGIN_COUNT, /* # of pages paged in */
> - MEM_CGROUP_STAT_PGPGOUT_COUNT, /* # of pages paged out */
> - MEM_CGROUP_STAT_SWAPOUT, /* # of pages, swapped out */
> - MEM_CGROUP_EVENTS, /* incremented at every pagein/pageout */
> - MEM_CGROUP_ON_MOVE, /* A check for locking move account/status */
> -
> - MEM_CGROUP_STAT_NSTATS,
> -};
>
> struct mem_cgroup_stat_cpu {
> s64 count[MEM_CGROUP_STAT_NSTATS];
> @@ -1512,7 +1494,8 @@ bool mem_cgroup_handle_oom(struct mem_cg
> * Currently used to update mapped file statistics, but the routine can be
> * generalized to update other statistics as well.
> */
> -void mem_cgroup_update_file_mapped(struct page *page, int val)
> +static void
> +mem_cgroup_update_file_stat(struct page *page, unsigned int idx, int val)
> {
> struct mem_cgroup *mem;
> struct page_cgroup *pc;
> @@ -1536,11 +1519,11 @@ void mem_cgroup_update_file_mapped(struc
> if (unlikely(!PageCgroupUsed(pc)))
> goto done;
> if (val > 0) {
> - this_cpu_inc(mem->stat->count[MEM_CGROUP_STAT_FILE_MAPPED]);
> - SetPageCgroupFileMapped(pc);
> + this_cpu_inc(mem->stat->count[idx]);
> + set_bit(fflag_idx(MEMCG_FSTAT_IDX(idx)), &pc->flags);
Do we use the bit in pc->flags, otherwise is there an advantage of
creating a separate index for the other stats the block I/O needs?
--
Three Cheers,
Balbir
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-08-03 3:58 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-02 10:11 [PATCH -mm 0/5] towards I/O aware memory cgroup v3 KAMEZAWA Hiroyuki
2010-08-02 10:13 ` [PATCH -mm 1/5] quick lookup memcg by ID KAMEZAWA Hiroyuki
2010-08-03 3:22 ` Balbir Singh
2010-08-03 3:21 ` KAMEZAWA Hiroyuki
2010-08-03 3:38 ` Balbir Singh
2010-08-03 4:31 ` Daisuke Nishimura
2010-08-03 4:37 ` KAMEZAWA Hiroyuki
2010-08-03 4:51 ` Daisuke Nishimura
2010-08-03 4:54 ` KAMEZAWA Hiroyuki
2010-08-03 5:04 ` Daisuke Nishimura
2010-08-02 10:14 ` [PATCH -mm 2/5] use ID in page cgroup KAMEZAWA Hiroyuki
2010-08-03 3:45 ` Balbir Singh
2010-08-03 3:48 ` KAMEZAWA Hiroyuki
2010-08-02 10:15 ` [PATCH -mm 3/5] memcg scalable file stat accounting method KAMEZAWA Hiroyuki
2010-08-03 3:33 ` Balbir Singh
2010-08-03 3:39 ` KAMEZAWA Hiroyuki
2010-08-04 0:55 ` Daisuke Nishimura
2010-08-04 1:11 ` KAMEZAWA Hiroyuki
2010-08-04 1:25 ` Daisuke Nishimura
2010-08-02 10:17 ` [PATCH -mm 4/5] memcg generic file stat accounting interface KAMEZAWA Hiroyuki
2010-08-03 4:03 ` Balbir Singh [this message]
2010-08-03 4:24 ` KAMEZAWA Hiroyuki
2010-08-02 10:20 ` [PATCH -mm 5/5] memcg: use spinlock in page_cgroup instead of bit_spinlock KAMEZAWA Hiroyuki
2010-08-03 4:06 ` Balbir Singh
2010-08-03 4:25 ` KAMEZAWA Hiroyuki
2010-08-03 2:36 ` [PATCH -mm 0/5] towards I/O aware memory cgroup v3 Balbir Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100803040304.GG3863@balbir.in.ibm.com \
--to=balbir@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=gthelen@google.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=m-ikeda@ds.jp.nec.com \
--cc=nishimura@mxp.nes.nec.co.jp \
--cc=vgoyal@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox