linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: nishimura@mxp.nes.nec.co.jp
Cc: Daisuke Nishimura <d-nishimura@mtf.biglobe.ne.jp>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Subject: Re: [RFC][1/3] memcg clean up try charge
Date: Wed, 2 Jun 2010 09:45:27 +0900	[thread overview]
Message-ID: <20100602094527.776cc1ce.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <20100601231914.6874165e.d-nishimura@mtf.biglobe.ne.jp>

On Tue, 1 Jun 2010 23:19:14 +0900
Daisuke Nishimura <d-nishimura@mtf.biglobe.ne.jp> wrote:

> On Tue, 1 Jun 2010 18:24:06 +0900
> KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> 
> > From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> > 
> > mem_cgroup_try_charge() has a big loop (doesn't fits in screee) and seems to be
> > hard to read. Most of routines are for slow paths. This patch moves codes out
> > from the loop and make it clear what's done.
> > 
> I like this cleanup :)
> 
> I have some comments for now.
> 
> > -	while (1) {
> > -		int ret = 0;
> > -		unsigned long flags = 0;
> > +	while (ret != CHARGE_OK) {
> > +		int nr_oom_retries = MEM_CGROUP_RECLAIM_RETRIES;
> reset nr_oom_retries at the beginning of every loop ? :)

This initialization is done only once ;) 

> I think this line should be at the top of this function, and we should do like:
> 
But ok, will do that.


>                 case CHARGE_RETRY: /* not in OOM situation but retry */
> 			nr_oom_retries = MEM_CGROUP_RECLAIM_RETRIES;
> 			csize = PAGE_SIZE;
> 			break;
> 
> later.
> 
Hmmmmmmm. ok.


> > +		case CHARGE_NOMEM: /* OOM routine works */
> >  			if (!oom)
> >  				goto nomem;
> > -			if (mem_cgroup_handle_oom(mem_over_limit, gfp_mask)) {
> > -				nr_retries = MEM_CGROUP_RECLAIM_RETRIES;
> > -				continue;
> > -			}
> > -			/* When we reach here, current task is dying .*/
> > -			css_put(&mem->css);
> > +			/* If !oom, we never return -ENOMEM */
> s/!oom/oom ?   
> 

yes.

Thanks,
-Kame

--
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-06-02  0:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-01  9:24 KAMEZAWA Hiroyuki
2010-06-01  9:27 ` [RFC][2/3] memcg safe operaton for checking a cgroup is under move accounts KAMEZAWA Hiroyuki
2010-06-01  9:29   ` [RFC][3/3] memcg swap accounts remove experimental KAMEZAWA Hiroyuki
2010-06-01 10:04     ` Balbir Singh
2010-06-01 13:24     ` Daisuke Nishimura
2010-06-01 11:25   ` [RFC][2/3] memcg safe operaton for checking a cgroup is under move accounts Balbir Singh
2010-06-02  0:37     ` KAMEZAWA Hiroyuki
2010-06-01 11:36 ` [RFC][1/3] memcg clean up try charge Balbir Singh
2010-06-02  0:42   ` KAMEZAWA Hiroyuki
2010-06-01 14:19 ` Daisuke Nishimura
2010-06-02  0:45   ` KAMEZAWA Hiroyuki [this message]
2010-06-02  1:39     ` Daisuke Nishimura

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=20100602094527.776cc1ce.kamezawa.hiroyu@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=d-nishimura@mtf.biglobe.ne.jp \
    --cc=linux-mm@kvack.org \
    --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