From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm <linux-mm@kvack.org>
Subject: Re: [BUGFIX][PATCH] memcg: fix try_get_mem_cgroup_from_swapcache()
Date: Mon, 27 Apr 2009 12:47:56 +0530 [thread overview]
Message-ID: <20090427071756.GF4454@balbir.in.ibm.com> (raw)
In-Reply-To: <20090427160846.fc970142.kamezawa.hiroyu@jp.fujitsu.com>
* KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2009-04-27 16:08:46]:
> On Mon, 27 Apr 2009 12:33:42 +0530
> Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
>
> > * KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2009-04-27 15:59:53]:
> >
> > > On Mon, 27 Apr 2009 12:23:58 +0530
> > > Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> > >
> > > > * nishimura@mxp.nes.nec.co.jp <nishimura@mxp.nes.nec.co.jp> [2009-04-27 09:51:00]:
> > > >
> > > > > From: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
> > > > >
> > > > > memcg: fix try_get_mem_cgroup_from_swapcache()
> > > > >
> > > > > This is a bugfix for commit 3c776e64660028236313f0e54f3a9945764422df(included 2.6.30-rc1).
> > > > > Used bit of swapcache is solid under page lock, but considering move_account,
> > > > > pc->mem_cgroup is not.
> > > > >
> > > > > We need lock_page_cgroup() anyway.
> > > > >
> > > > > Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
> > > >
> > > > I think we need to start documenting the locks the
> > > > page_cgroup lock nests under.
> > > >
> > > Addin some comments on source code may be necessary.
> > >
> > > > If memcg_tasklist were a spinlock instead of mutex, could we use that
> > > > instead of page_cgroup lock, since we care only about task migration?
> > > >
> > >
> > > Hmm ? Another problem ? I can't catch what you ask.
> > > move_account() is a function called by force_empty()->"move account to parent"
> >
> > IIUC, pc->mem_cgroup might change due to task migration and that is
> > why we've added the page cgroup lock.
>
> "task" migration ? I think it's "page" migration.
>
OK
> "page cgroup lock" is necessary because we have to modify 2 params
> (pc->flags and pc->mem_cgroup) at once.
>
Yes, definitely!
> > If the race is between task
> > migration and force_empty(), we can use the memcg_tasklist by making
> > it a spinlock.
> >
> The race is between force_empty() and any other swap accounitng ops.
> This patch is good enough from my point of view.
Fair enough
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
--
Balbir
--
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>
prev parent reply other threads:[~2009-04-27 7:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20090426231752.36498c90.d-nishimura@mtf.biglobe.ne.jp>
2009-04-27 0:51 ` [BUGFIX][PATCH] memcg: fix try_get_mem_cgroup_from_swapcache() Daisuke Nishimura
2009-04-27 1:14 ` KAMEZAWA Hiroyuki
2009-04-27 6:53 ` Balbir Singh
2009-04-27 6:59 ` KAMEZAWA Hiroyuki
2009-04-27 7:03 ` Balbir Singh
2009-04-27 7:08 ` KAMEZAWA Hiroyuki
2009-04-27 7:17 ` Balbir Singh [this message]
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=20090427071756.GF4454@balbir.in.ibm.com \
--to=balbir@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--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;
as well as URLs for NNTP newsgroup(s).