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: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>,
	"menage@google.com" <menage@google.com>
Subject: Re: [RFC][PATCH] cgroup: fix permanent wait in rmdir
Date: Tue, 23 Jun 2009 13:44:20 +0900	[thread overview]
Message-ID: <20090623134420.9103eac5.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <20090623131333.be387c84.nishimura@mxp.nes.nec.co.jp>

On Tue, 23 Jun 2009 13:13:33 +0900
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> wrote:

> On Tue, 23 Jun 2009 09:22:23 +0900, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> > On Mon, 22 Jun 2009 18:37:07 +0900
> > KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> > 
> > > previous discussion was this => http://marc.info/?t=124478543600001&r=1&w=2
> > > 
> > > I think this is a minimum fix (in code size and behavior) and because
> > > we can take a BIG LOCK, this kind of check is necessary, anyway.
> > > Any comments are welcome.
> > 
> > I'll split this into 2 patches...and I found I should check page-migration, too.
> I'll wait a new version, but can you explain in advance this page-migration case ?
> 

Not far from swap-in case.

Assume cgroup "A" which includes file caches. A task in other group mmap file caches
and do page migration and rmdir against "A" is called at the same time.

In mem_cgroup_prepare_migration(), following check is used.

==
	lock_page_cgroup(pc);
	if (PageCgroupUsed(pc)) {
		mem = pc->mem_cgroup;
		css_get(&mem->css);
	}
	unlock_page_cgroup(pc);
	<======================================(*)
	if (mem) {
		<==============================(**)
		try_charge();
		...
	}
==

At (*), we grab css refcnt which can be under pre_destroy() and
At (**), pre_destroy may returns 0 but charge may be done after the end of pre_destroy().


> > > +static int mem_cgroup_retry_rmdir(struct cgroup_subsys *ss,
> > > +				  struct cgroup *cont)
> > > +{
> > > +	struct mem_cgroup *mem = mem_cgroup_from_cont(cont);
> > > +
> > > +	if (res_counter_read_u64(&memcg->res, RES_USAGE))
> It should be &mem->res.
> 
yes.
too many typos in my patches in these days..

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:[~2009-06-23  4:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-22  9:37 KAMEZAWA Hiroyuki
2009-06-22 10:52 ` Ingo Molnar
2009-06-22 11:27   ` KAMEZAWA Hiroyuki
2009-06-22 12:16     ` Balbir Singh
2009-06-22 12:20     ` KAMEZAWA Hiroyuki
2009-06-22 12:26       ` Ingo Molnar
2009-06-22 12:32         ` KAMEZAWA Hiroyuki
2009-06-22 23:57   ` [BUGFIX][PATCH] fix bad page removal from LRU (Was " KAMEZAWA Hiroyuki
2009-06-23  0:47     ` Balbir Singh
2009-06-23  7:27     ` Daisuke Nishimura
2009-06-23  7:29       ` KAMEZAWA Hiroyuki
2009-06-23  0:22 ` KAMEZAWA Hiroyuki
2009-06-23  4:13   ` Daisuke Nishimura
2009-06-23  4:44     ` KAMEZAWA Hiroyuki [this message]
2009-06-23  4:54       ` 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=20090623134420.9103eac5.kamezawa.hiroyu@jp.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=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