linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "KAMEZAWA Hiroyuki" <kamezawa.hiroyu@jp.fujitsu.com>
To: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"menage@google.com" <menage@google.com>,
	"lizf@cn.fujitsu.com" <lizf@cn.fujitsu.com>,
	"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/7] memcg : use CSS ID in memcg
Date: Fri, 23 Jan 2009 18:49:57 +0900 (JST)	[thread overview]
Message-ID: <c2cf91864adcd1461b14f491dcafd17e.squirrel@webmail-b.css.fujitsu.com> (raw)
In-Reply-To: <20090123162232.5a81e0d3.nishimura@mxp.nes.nec.co.jp>

Daisuke Nishimura さんは書きました:
> On Thu, 22 Jan 2009 18:35:57 +0900, KAMEZAWA Hiroyuki
> <kamezawa.hiroyu@jp.fujitsu.com> wrote:
>>
>> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>> Use css ID in memcg.
>>
>> Assigning CSS ID for each memcg and use css_get_next() for scanning
>> hierarchy.
>>
>> 	Assume folloing tree.
>>
>> 	group_A (ID=3)
>> 		/01 (ID=4)
>> 		   /0A (ID=7)
>> 		/02 (ID=10)
>> 	group_B (ID=5)
>> 	and task in group_A/01/0A hits limit at group_A.
>>
>> 	reclaim will be done in following order (round-robin).
>> 	group_A(3) -> group_A/01 (4) -> group_A/01/0A (7) -> group_A/02(10)
>> 	-> group_A -> .....
>>
>> 	Round robin by ID. The last visited cgroup is recorded and restart
>> 	from it when it start reclaim again.
>> 	(More smart algorithm can be implemented..)
>>
>> 	No cgroup_mutex or hierarchy_mutex is required.
>>
>> Changelog (v3) -> (v4)
>>   - dropped css_is_populated() check
>>   - removed scan_age and use more simple logic.
>>
> I think a check for mem_cgroup_local_usage is also added by this version
> :)
>
>> Changelog (v2) -> (v3)
>>   - Added css_is_populatd() check
>>   - Adjusted to rc1 + Nishimrua's fixes.
>>   - Increased comments.
>>
>> Changelog (v1) -> (v2)
>>   - Updated texts.
>>
>> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>>
>> ---
>>  mm/memcontrol.c |  220
>> ++++++++++++++++++++------------------------------------
>>  1 file changed, 82 insertions(+), 138 deletions(-)
>>
>> Index: mmotm-2.6.29-Jan16/mm/memcontrol.c
>> ===================================================================
>> --- mmotm-2.6.29-Jan16.orig/mm/memcontrol.c
>> +++ mmotm-2.6.29-Jan16/mm/memcontrol.c
>> @@ -95,6 +95,15 @@ static s64 mem_cgroup_read_stat(struct m
>>  	return ret;
>>  }
>>
>> +static s64 mem_cgroup_local_usage(struct mem_cgroup_stat *stat)
>> +{
>> +	s64 ret;
>> +
> It would be better to initialize it to 0.
>
Hmm ? why ?
> 	Reviewed-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
>
> Thanks,
> Daisuke Nishimura.
>

Thanks,
-Kame


>> +	ret = mem_cgroup_read_stat(stat, MEM_CGROUP_STAT_CACHE);
>> +	ret += mem_cgroup_read_stat(stat, MEM_CGROUP_STAT_RSS);
>> +	return ret;
>> +}
>> +


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

  parent reply	other threads:[~2009-01-23  9:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22  9:34 [PATCH 0/7] cgroup/memcg updates 2009/01/22 KAMEZAWA Hiroyuki
2009-01-22  9:35 ` [PATCH 1/7] cgroup: add CSS ID KAMEZAWA Hiroyuki
2009-01-23  6:02   ` Daisuke Nishimura
2009-01-22  9:35 ` [PATCH 2/7] memcg : use CSS ID in memcg KAMEZAWA Hiroyuki
2009-01-23  7:22   ` Daisuke Nishimura
2009-01-23  8:04     ` Daisuke Nishimura
2009-01-23  9:49     ` KAMEZAWA Hiroyuki [this message]
2009-01-22  9:36 ` [PATCH 3/7] memcg: show hierarchical stat KAMEZAWA Hiroyuki
2009-01-22  9:38 ` [FIX][PATCH 4/7] memcg : make set_limit return -EBUSY after reasonable retries KAMEZAWA Hiroyuki
2009-01-22  9:39 ` [FIX][PATCH 5/7] memcg : fix OOM Killer behavior under memcg KAMEZAWA Hiroyuki
2009-01-22  9:40 ` [FIX][PATCH 6/7] cgroup/memcg: fix frequent -EBUSY at rmdir KAMEZAWA Hiroyuki
2009-01-27  0:58   ` Randy Dunlap
2009-01-28  0:09     ` KAMEZAWA Hiroyuki
2009-01-22  9:41 ` [RFC] [PATCH 7/7] memcg: background reclaim (example) KAMEZAWA Hiroyuki

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=c2cf91864adcd1461b14f491dcafd17e.squirrel@webmail-b.css.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=menage@google.com \
    --cc=nishimura@mxp.nes.nec.co.jp \
    /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;
as well as URLs for NNTP newsgroup(s).