[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20111221130056.2f4a39b2.kamezawa.hiroyu@jp.fujitsu.com>
Date: Wed, 21 Dec 2011 13:00:56 +0900
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To: Hugh Dickins <hughd@...gle.com>
Cc: Hiroyuki Kamezawa <kamezawa.hiroyuki@...il.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>, cgroups@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"hannes@...xchg.org" <hannes@...xchg.org>,
Michal Hocko <mhocko@...e.cz>
Subject: Re: [PATCH] memcg: reset to root_mem_cgroup at bypassing
On Tue, 20 Dec 2011 19:25:04 -0800 (PST)
Hugh Dickins <hughd@...gle.com> wrote:
> On Wed, 21 Dec 2011, KAMEZAWA Hiroyuki wrote:
> > On Tue, 20 Dec 2011 09:24:47 +0900
> > Hiroyuki Kamezawa <kamezawa.hiroyuki@...il.com> wrote:
> > > 2011/12/20 Hugh Dickins <hughd@...gle.com>:
> > >
> > > > I speak from experience: I did *exactly* the same at "bypass" when
> > > > I introduced our mem_cgroup_reset_page(), which corresponds to your
> > > > mem_cgroup_reset_owner(); it seemed right to me that a successful
> > > > (return 0) call to try_charge() should provide a good *ptr.
> > > >
> > > ok.
> > >
> > > > But others (Ying and Greg) pointed out that it changes the semantics
> > > > of __mem_cgroup_try_charge() in this case, so you need to justify the
> > > > change to all those places which do something like "if (ret || !memcg)"
> > > > after calling it. Perhaps it is a good change everywhere, but that's
> > > > not obvious, so we chose caution.
> > > >
> > > > Doesn't it lead to bypass pages being marked as charged to root, so
> > > > they don't get charged to the right owner next time they're touched?
> > > >
> > > Yes. You're right.
> > > Hm. So, it seems I should add reset_owner() to the !memcg path
> > > rather than here.
> > >
> > Considering this again..
> >
> > Now, we catch 'charge' event only once in lifetime of anon/file page.
> > So, it doesn't depend on that it's marked as PCG_USED or not.
>
> That's an interesting argument, I hadn't been looking at it that way.
> It's not true of swapcache, but I guess we don't need to preserve its
> peculiarities in this case.
>
> I've not checked the (ret || !memcg) cases yet to see if any change
> needed there.
>
> I certainly like that the success return guarantees that memcg is set.
>
Hmm. Ok, then....I'll update patch description to be precise.
And check I can remove !memcg case in the same patch. Then, repost v2.
Thanks,
-Kame
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists