From: Hugh Dickins <hughd@google.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hiroyuki Kamezawa <kamezawa.hiroyuki@gmail.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
cgroups@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"hannes@cmpxchg.org" <hannes@cmpxchg.org>,
Michal Hocko <mhocko@suse.cz>
Subject: Re: [PATCH] memcg: reset to root_mem_cgroup at bypassing
Date: Tue, 20 Dec 2011 19:25:04 -0800 (PST) [thread overview]
Message-ID: <alpine.LSU.2.00.1112201847500.1310@eggly.anvils> (raw)
In-Reply-To: <20111221091347.4f1a10d8.kamezawa.hiroyu@jp.fujitsu.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1655 bytes --]
On Wed, 21 Dec 2011, KAMEZAWA Hiroyuki wrote:
> On Tue, 20 Dec 2011 09:24:47 +0900
> Hiroyuki Kamezawa <kamezawa.hiroyuki@gmail.com> wrote:
> > 2011/12/20 Hugh Dickins <hughd@google.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.
Hugh
next prev parent reply other threads:[~2011-12-21 3:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-19 7:51 KAMEZAWA Hiroyuki
2011-12-19 20:49 ` Hugh Dickins
2011-12-20 0:24 ` Hiroyuki Kamezawa
2011-12-21 0:13 ` KAMEZAWA Hiroyuki
2011-12-21 3:25 ` Hugh Dickins [this message]
2011-12-21 4:00 ` KAMEZAWA Hiroyuki
2011-12-21 8:24 ` [PATCH v2] memcg: return -EINTR at bypassing try_charge() KAMEZAWA Hiroyuki
2011-12-21 9:57 ` Johannes Weiner
2011-12-21 10:08 ` KAMEZAWA Hiroyuki
2011-12-21 10:29 ` [PATCH v3] " KAMEZAWA Hiroyuki
2011-12-21 12:28 ` Johannes Weiner
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=alpine.LSU.2.00.1112201847500.1310@eggly.anvils \
--to=hughd@google.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kamezawa.hiroyuki@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.cz \
/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