lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100803132403.ef7f50ed.kamezawa.hiroyu@jp.fujitsu.com>
Date:	Tue, 3 Aug 2010 13:24:03 +0900
From:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To:	balbir@...ux.vnet.ibm.com
Cc:	linux-mm@...ck.org,
	"nishimura@....nes.nec.co.jp" <nishimura@....nes.nec.co.jp>,
	vgoyal@...hat.com, m-ikeda@...jp.nec.com, gthelen@...gle.com,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -mm 4/5] memcg generic file stat accounting interface.

On Tue, 3 Aug 2010 09:33:04 +0530
Balbir Singh <balbir@...ux.vnet.ibm.com> wrote:

> * KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com> [2010-08-02 19:17:15]:
> 
> > From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...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@...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?
> 
Ahhhh, it's a garbae. sorry.

> > +	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?
> 
??? using pc->flags.

use SetPageFileMapped() etc.. and drop this patch ?
I don't want to add swtich(idx) to call SetPageFileMapped() etc.


Thanks,
-Kmae


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ