All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Righi <arighi@develer.com>
To: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	containers@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Suleiman Souhlal <suleiman@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vivek Goyal <vgoyal@redhat.com>
Subject: Re: [PATCH -mmotm 1/2] memcg: dirty pages accounting and limiting infrastructure
Date: Mon, 1 Mar 2010 11:30:01 +0100	[thread overview]
Message-ID: <20100301103001.GB2087@linux> (raw)
In-Reply-To: <20100301170535.2f1db0ed.nishimura@mxp.nes.nec.co.jp>

On Mon, Mar 01, 2010 at 05:05:35PM +0900, Daisuke Nishimura wrote:
> On Fri, 26 Feb 2010 23:52:30 +0100, Andrea Righi <arighi@develer.com> wrote:
> > Infrastructure to account dirty pages per cgroup and add dirty limit
> > interfaces in the cgroupfs:
> > 
> >  - Active write-out: memory.dirty_ratio, memory.dirty_bytes
> >  - Background write-out: memory.dirty_background_ratio, memory.dirty_background_bytes
> > 
> It looks good for me in general.
> 
> > Signed-off-by: Andrea Righi <arighi@develer.com>
> > ---
> >  include/linux/memcontrol.h |   74 +++++++++-
> >  mm/memcontrol.c            |  354 ++++++++++++++++++++++++++++++++++++++++----
> >  2 files changed, 399 insertions(+), 29 deletions(-)
> > 
> 
> (snip)
> 
> > +s64 mem_cgroup_page_stat(enum mem_cgroup_page_stat_item item)
> > +{
> > +	struct mem_cgroup_page_stat stat = {};
> > +	struct mem_cgroup *memcg;
> > +
> I think it would be better to add "if (mem_cgroup_disabled())".

Agreed.

> 
> > +	rcu_read_lock();
> > +	memcg = mem_cgroup_from_task(current);
> > +	if (memcg) {
> > +		/*
> > +		 * Recursively evaulate page statistics against all cgroup
> > +		 * under hierarchy tree
> > +		 */
> > +		stat.item = item;
> > +		mem_cgroup_walk_tree(memcg, &stat, mem_cgroup_page_stat_cb);
> > +	} else
> > +		stat.value = -ENOMEM;
> > +	rcu_read_unlock();
> > +
> > +	return stat.value;
> > +}
> > +
> >  static int mem_cgroup_count_children_cb(struct mem_cgroup *mem, void *data)
> >  {
> >  	int *val = data;
> > @@ -1263,10 +1419,10 @@ static void record_last_oom(struct mem_cgroup *mem)
> >  }
> >  
> >  /*
> > - * Currently used to update mapped file statistics, but the routine can be
> > - * generalized to update other statistics as well.
> > + * Generalized routine to update memory cgroup statistics.
> >   */
> > -void mem_cgroup_update_file_mapped(struct page *page, int val)
> > +void mem_cgroup_update_stat(struct page *page,
> > +			enum mem_cgroup_stat_index idx, int val)
> >  {
> >  	struct mem_cgroup *mem;
> >  	struct page_cgroup *pc;
> ditto.

Agreed.

Thanks,
-Andrea

WARNING: multiple messages have this Message-ID (diff)
From: Andrea Righi <arighi@develer.com>
To: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	containers@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Suleiman Souhlal <suleiman@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vivek Goyal <vgoyal@redhat.com>
Subject: Re: [PATCH -mmotm 1/2] memcg: dirty pages accounting and limiting infrastructure
Date: Mon, 1 Mar 2010 11:30:01 +0100	[thread overview]
Message-ID: <20100301103001.GB2087@linux> (raw)
In-Reply-To: <20100301170535.2f1db0ed.nishimura@mxp.nes.nec.co.jp>

On Mon, Mar 01, 2010 at 05:05:35PM +0900, Daisuke Nishimura wrote:
> On Fri, 26 Feb 2010 23:52:30 +0100, Andrea Righi <arighi@develer.com> wrote:
> > Infrastructure to account dirty pages per cgroup and add dirty limit
> > interfaces in the cgroupfs:
> > 
> >  - Active write-out: memory.dirty_ratio, memory.dirty_bytes
> >  - Background write-out: memory.dirty_background_ratio, memory.dirty_background_bytes
> > 
> It looks good for me in general.
> 
> > Signed-off-by: Andrea Righi <arighi@develer.com>
> > ---
> >  include/linux/memcontrol.h |   74 +++++++++-
> >  mm/memcontrol.c            |  354 ++++++++++++++++++++++++++++++++++++++++----
> >  2 files changed, 399 insertions(+), 29 deletions(-)
> > 
> 
> (snip)
> 
> > +s64 mem_cgroup_page_stat(enum mem_cgroup_page_stat_item item)
> > +{
> > +	struct mem_cgroup_page_stat stat = {};
> > +	struct mem_cgroup *memcg;
> > +
> I think it would be better to add "if (mem_cgroup_disabled())".

Agreed.

> 
> > +	rcu_read_lock();
> > +	memcg = mem_cgroup_from_task(current);
> > +	if (memcg) {
> > +		/*
> > +		 * Recursively evaulate page statistics against all cgroup
> > +		 * under hierarchy tree
> > +		 */
> > +		stat.item = item;
> > +		mem_cgroup_walk_tree(memcg, &stat, mem_cgroup_page_stat_cb);
> > +	} else
> > +		stat.value = -ENOMEM;
> > +	rcu_read_unlock();
> > +
> > +	return stat.value;
> > +}
> > +
> >  static int mem_cgroup_count_children_cb(struct mem_cgroup *mem, void *data)
> >  {
> >  	int *val = data;
> > @@ -1263,10 +1419,10 @@ static void record_last_oom(struct mem_cgroup *mem)
> >  }
> >  
> >  /*
> > - * Currently used to update mapped file statistics, but the routine can be
> > - * generalized to update other statistics as well.
> > + * Generalized routine to update memory cgroup statistics.
> >   */
> > -void mem_cgroup_update_file_mapped(struct page *page, int val)
> > +void mem_cgroup_update_stat(struct page *page,
> > +			enum mem_cgroup_stat_index idx, int val)
> >  {
> >  	struct mem_cgroup *mem;
> >  	struct page_cgroup *pc;
> ditto.

Agreed.

Thanks,
-Andrea

--
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>

  reply	other threads:[~2010-03-01 10:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-26 22:52 [PATCH -mmotm 0/2] memcg: per cgroup dirty limit (v2) Andrea Righi
2010-02-26 22:52 ` Andrea Righi
     [not found] ` <1267224751-6382-1-git-send-email-arighi-vWjgImWzx8FBDgjK7y7TUQ@public.gmane.org>
2010-02-26 22:52   ` [PATCH -mmotm 1/2] memcg: dirty pages accounting and limiting infrastructure Andrea Righi
2010-02-26 22:52   ` [PATCH -mmotm 2/2] memcg: dirty pages instrumentation Andrea Righi
2010-02-26 22:52 ` [PATCH -mmotm 1/2] memcg: dirty pages accounting and limiting infrastructure Andrea Righi
2010-02-26 22:52   ` Andrea Righi
2010-03-01  1:09   ` KAMEZAWA Hiroyuki
2010-03-01  1:09     ` KAMEZAWA Hiroyuki
     [not found]     ` <20100301100910.1d8bd486.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2010-03-01 10:24       ` Andrea Righi
2010-03-01 10:24     ` Andrea Righi
2010-03-01 10:24       ` Andrea Righi
2010-03-01  8:05   ` Daisuke Nishimura
2010-03-01  8:05     ` Daisuke Nishimura
2010-03-01 10:30     ` Andrea Righi [this message]
2010-03-01 10:30       ` Andrea Righi
     [not found]     ` <20100301170535.2f1db0ed.nishimura-YQH0OdQVrdy45+QrQBaojngSJqDPrsil@public.gmane.org>
2010-03-01 10:30       ` Andrea Righi
     [not found]   ` <1267224751-6382-2-git-send-email-arighi-vWjgImWzx8FBDgjK7y7TUQ@public.gmane.org>
2010-03-01  1:09     ` KAMEZAWA Hiroyuki
2010-03-01  8:05     ` Daisuke Nishimura
2010-03-01  8:58     ` Kirill A. Shutemov
2010-03-01  8:58   ` Kirill A. Shutemov
2010-03-01  8:58     ` Kirill A. Shutemov
     [not found]     ` <cc557aab1003010058i3a824f98l4cec173fac05911f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-03-01 10:38       ` Andrea Righi
2010-03-01 10:38     ` Andrea Righi
2010-03-01 10:38       ` Andrea Righi
2010-02-26 22:52 ` [PATCH -mmotm 2/2] memcg: dirty pages instrumentation Andrea Righi
2010-02-26 22:52   ` Andrea Righi

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=20100301103001.GB2087@linux \
    --to=arighi@develer.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nishimura@mxp.nes.nec.co.jp \
    --cc=suleiman@google.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.