From: Michal Hocko <mhocko@suse.cz>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
linux-mm <linux-mm@kvack.org>,
David Rientjes <rientjes@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH v2 2/2] memcg: remove -ENOMEM at page migration.
Date: Wed, 4 Jul 2012 15:38:00 +0200 [thread overview]
Message-ID: <20120704133800.GH29842@tiehlicka.suse.cz> (raw)
In-Reply-To: <20120704131302.GC7881@cmpxchg.org>
On Wed 04-07-12 15:13:02, Johannes Weiner wrote:
> On Wed, Jul 04, 2012 at 02:04:45PM +0200, Michal Hocko wrote:
> > On Wed 04-07-12 10:30:19, Johannes Weiner wrote:
[...]
> > > Can we instead not charge the new page, just commit it while holding
> > > on to a css refcount, and have end_migration call a version of
> > > __mem_cgroup_uncharge_common() that updates the stats but leaves the
> > > res counters alone?
> >
> > Yes, this is also a way to go. Both approaches have to lie a bit and
> > both have a discrepancy between stat and usage_in_bytes. I guess we can
> > live with that.
> > Kame's solution seems easier but yours prevent from a corner case when
> > the reclaim is triggered due to artificial charges so I guess it is
> > better to go with yours.
> > Few (trivial) comments on the patch bellow.
>
> It's true that the cache/rss statistics still account for both pages.
> But they don't have behavioural impact and so I didn't bother.
Only if somebody watches those numbers and blows up if rss+cache >
limit_in_bytes. I can imagine an LTP test like that. But the test would
need to trigger migration in the background...
> We could still fix this up later, but it's less urgent, I think.
Yes, I guess so
>
> > > @@ -2955,7 +2956,10 @@ __mem_cgroup_uncharge_common(struct page *page, enum charge_type ctype)
> > > /* fallthrough */
> > > case MEM_CGROUP_CHARGE_TYPE_DROP:
> > > /* See mem_cgroup_prepare_migration() */
> > > - if (page_mapped(page) || PageCgroupMigration(pc))
> > > + if (page_mapped(page))
> > > + goto unlock_out;
> >
> > Don't need that test or remove the one below (seems easier to read
> > because those cases are really different things).
> >
> > > + if (page_mapped(page) || (!end_migration &&
> > > + PageCgroupMigration(pc)))
>
> My bad, I meant to remove this second page_mapped() and forgot. Will
> fix. I take it
>
> if (page_mapped(page))
> goto unlock_out;
> if (!end_migration && PageCgroupMigration(pc))
> goto unlock_out;
>
> is what you had in mind?
Yes
--
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9
Czech Republic
--
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>
next prev parent reply other threads:[~2012-07-04 13:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-04 2:56 [PATCH v2 1/2] memcg: add res_counter_usage_safe() Kamezawa Hiroyuki
2012-07-04 2:58 ` [PATCH v2 2/2] memcg: remove -ENOMEM at page migration Kamezawa Hiroyuki
2012-07-04 8:30 ` Johannes Weiner
2012-07-04 8:39 ` Kamezawa Hiroyuki
2012-07-04 12:04 ` Michal Hocko
2012-07-04 13:13 ` Johannes Weiner
2012-07-04 13:38 ` Michal Hocko [this message]
2012-07-04 9:14 ` [PATCH v2 1/2] memcg: add res_counter_usage_safe() Johannes Weiner
2012-07-04 9:30 ` Kamezawa Hiroyuki
2012-07-04 9:40 ` Glauber Costa
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=20120704133800.GH29842@tiehlicka.suse.cz \
--to=mhocko@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=tj@kernel.org \
/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