From: Michal Hocko <mhocko@suse.cz>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"hannes@cmpxchg.org" <hannes@cmpxchg.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
Hugh Dickins <hughd@google.com>, Ying Han <yinghan@google.com>
Subject: Re: [PATCH 4/4] memcg: simplify LRU handling by new rule
Date: Wed, 21 Dec 2011 07:56:12 +0100 [thread overview]
Message-ID: <20111221065612.GB27137@tiehlicka.suse.cz> (raw)
In-Reply-To: <20111221090941.6bc25b6f.kamezawa.hiroyu@jp.fujitsu.com>
On Wed 21-12-11 09:09:41, KAMEZAWA Hiroyuki wrote:
> On Tue, 20 Dec 2011 17:16:15 +0100
> Michal Hocko <mhocko@suse.cz> wrote:
>
> > On Wed 14-12-11 16:52:26, KAMEZAWA Hiroyuki wrote:
> > > From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> > >
> > > Now, at LRU handling, memory cgroup needs to do complicated works
> > > to see valid pc->mem_cgroup, which may be overwritten.
> > >
> > > This patch is for relaxing the protocol. This patch guarantees
> > > - when pc->mem_cgroup is overwritten, page must not be on LRU.
> >
> > How the patch guarantees that? I do not see any enforcement. In fact we
> > depend on the previous patches, don't we.
> >
>
> Ah, yes. We depends on previous patch series.
>
>
> > >
> > > By this, LRU routine can believe pc->mem_cgroup and don't need to
> > > check bits on pc->flags. This new rule may adds small overheads to
> > > swapin. But in most case, lru handling gets faster.
> > >
> > > After this patch, PCG_ACCT_LRU bit is obsolete and removed.
> >
> > It makes things much more simpler. I just think it needs a better
> > description.
> >
>
> O.K.
>
> 99% of memcg charging are done by following call path.
>
> - alloc_page() -> charge() -> map/enter radix-tree -> add to LRU.
>
> We need some special case cares.
>
> - SwapCache - newly allocated/fully unmapped pages are added to LRU
> before charge.
> => handled by previous patch.
> - FUSE - unused pages are reused.
> => handled by previous patch.
>
> - move_account
> => we do isolate_page().
>
> Now, we can guarantee pc->mem_cgroup is set when page is not added to
> LRU or under zone->lru_lock + isolate from LRU.
>
> I'll add some Documenation to...memcg_debug.txt
Yes, much better.
Btw. I forgot to add
Acked-by: Michal Hocko <mhocko@suse.cz>
Thanks
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-12-21 6:56 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-14 7:47 [PATCH 0/4] memcg: simplify LRU handling KAMEZAWA Hiroyuki
2011-12-14 7:49 ` [PATCH 1/4] memcg: simplify page cache charging KAMEZAWA Hiroyuki
2011-12-16 22:28 ` Andrew Morton
2011-12-19 0:01 ` KAMEZAWA Hiroyuki
2011-12-20 21:58 ` Andrew Morton
2011-12-21 0:01 ` KAMEZAWA Hiroyuki
2011-12-19 15:04 ` Johannes Weiner
2011-12-20 15:33 ` Michal Hocko
2011-12-14 7:50 ` [PATCH 2/4] memcg: simplify corner case handling of LRU KAMEZAWA Hiroyuki
2011-12-19 15:14 ` Johannes Weiner
2011-12-20 15:05 ` Michal Hocko
2011-12-14 7:51 ` [PATCH 3/4] memcg: clear pc->mem_cgorup if necessary KAMEZAWA Hiroyuki
2011-12-16 22:30 ` Andrew Morton
2011-12-19 15:37 ` Johannes Weiner
2011-12-20 0:35 ` Hiroyuki Kamezawa
2011-12-20 15:56 ` Michal Hocko
2011-12-14 7:52 ` [PATCH 4/4] memcg: simplify LRU handling by new rule KAMEZAWA Hiroyuki
2011-12-19 15:48 ` Johannes Weiner
2011-12-20 16:16 ` Michal Hocko
2011-12-21 0:09 ` KAMEZAWA Hiroyuki
2011-12-21 6:56 ` Michal Hocko [this message]
2011-12-19 15:56 ` [PATCH 0/4] memcg: simplify LRU handling 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=20111221065612.GB27137@tiehlicka.suse.cz \
--to=mhocko@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=yinghan@google.com \
/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