From: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: nishimura@mxp.nes.nec.co.jp,
Daisuke Nishimura <d-nishimura@mtf.biglobe.ne.jp>,
linux-mm <linux-mm@kvack.org>,
Balbir Singh <balbir@linux.vnet.ibm.com>,
Hugh Dickins <hugh@veritas.com>
Subject: Re: [PATCH] fix unused/stale swap cache handling on memcg v3
Date: Tue, 24 Mar 2009 17:32:18 +0900 [thread overview]
Message-ID: <20090324173218.4de33b90.nishimura@mxp.nes.nec.co.jp> (raw)
In-Reply-To: <20090323142242.f6659457.kamezawa.hiroyu@jp.fujitsu.com>
On Mon, 23 Mar 2009 14:22:42 +0900, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> On Mon, 23 Mar 2009 14:04:19 +0900
> Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> wrote:
>
> > > Nice clean-up here :)
> > >
> > Thanks, I'll send a cleanup patch for this part later.
> >
> Thank you, I'll look into.
>
> > > > @@ -1359,18 +1373,40 @@ charge_cur_mm:
> > > > return __mem_cgroup_try_charge(mm, mask, ptr, true);
> > > > }
> > > >
> > > > -void mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *ptr)
> > > > +static void
> > > > +__mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *ptr,
> > > > + enum charge_type ctype)
> > > > {
> > > > - struct page_cgroup *pc;
> > > > + unsigned long flags;
> > > > + struct zone *zone = page_zone(page);
> > > > + struct page_cgroup *pc = lookup_page_cgroup(page);
> > > > + int locked = 0;
> > > >
> > > > if (mem_cgroup_disabled())
> > > > return;
> > > > if (!ptr)
> > > > return;
> > > > - pc = lookup_page_cgroup(page);
> > > > - mem_cgroup_lru_del_before_commit_swapcache(page);
> > > > - __mem_cgroup_commit_charge(ptr, pc, MEM_CGROUP_CHARGE_TYPE_MAPPED);
> > > > - mem_cgroup_lru_add_after_commit_swapcache(page);
> > > > +
> > > > + /*
> > > > + * Forget old LRU when this page_cgroup is *not* used. This Used bit
> > > > + * is guarded by lock_page() because the page is SwapCache.
> > > > + * If this pc is on orphan LRU, it is also removed from orphan LRU here.
> > > > + */
> > > > + if (!PageCgroupUsed(pc)) {
> > > > + locked = 1;
> > > > + spin_lock_irqsave(&zone->lru_lock, flags);
> > > > + mem_cgroup_del_lru_list(page, page_lru(page));
> > > > + }
> > > Maybe nice. I tried to use lock_page_cgroup() in add_list but I can't ;(
> > > I think this works well. But I wonder...why you have to check PageCgroupUsed() ?
> > > And is it correct ? Removing PageCgroupUsed() bit check is nice.
> > > (This will be "usually returns true" check, anyway)
> > >
> > I've just copied lru_del_before_commit_swapcache.
> >
> ya, considering now, it seems to be silly quick-hack.
>
> > As you say, this check will return false only in (C) case in memcg_test.txt,
> > and even in (C) case calling mem_cgroup_del_lru_list(and mem_cgroup_add_lru_list later)
> > would be no problem.
> >
> > OK, I'll remove this check.
> >
> Thanks,
>
> > This is the updated version(w/o cache_charge cleanup).
> >
> > BTW, Should I merge reclaim part based on your patch and post it ?
> >
> I think not necessary. keeping changes minimum is important as BUGFIX.
> We can visit here again when new -RC stage starts.
>
> no problem from my review.
> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>
Just FYI, this version of orphan list framework works fine
w/o causing BUG more than 24h.
So, I believe we can implement reclaim part based on this
to fix the original problem.
Thanks,
Daisuke Nishimura.
--
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:[~2009-03-24 8:28 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-17 4:57 [RFC] memcg: handle swapcache leak Daisuke Nishimura
2009-03-17 5:39 ` KAMEZAWA Hiroyuki
2009-03-17 6:11 ` Daisuke Nishimura
2009-03-17 7:29 ` KAMEZAWA Hiroyuki
2009-03-17 9:38 ` KAMEZAWA Hiroyuki
2009-03-18 1:17 ` Daisuke Nishimura
2009-03-18 1:34 ` KAMEZAWA Hiroyuki
2009-03-18 3:51 ` Daisuke Nishimura
2009-03-18 4:05 ` KAMEZAWA Hiroyuki
2009-03-18 8:57 ` [PATCH] fix unused/stale swap cache handling on memcg v1 (Re: " KAMEZAWA Hiroyuki
2009-03-18 14:17 ` Daisuke Nishimura
2009-03-18 23:45 ` KAMEZAWA Hiroyuki
2009-03-19 2:16 ` KAMEZAWA Hiroyuki
2009-03-19 9:06 ` [PATCH] fix unused/stale swap cache handling on memcg v2 KAMEZAWA Hiroyuki
2009-03-19 10:01 ` Daisuke Nishimura
2009-03-19 10:13 ` Daisuke Nishimura
2009-03-19 10:46 ` KAMEZAWA Hiroyuki
2009-03-19 11:36 ` KAMEZAWA Hiroyuki
2009-03-20 7:45 ` [PATCH] fix unused/stale swap cache handling on memcg v3 KAMEZAWA Hiroyuki
2009-03-23 1:45 ` Daisuke Nishimura
2009-03-23 2:41 ` KAMEZAWA Hiroyuki
2009-03-23 5:04 ` Daisuke Nishimura
2009-03-23 5:22 ` KAMEZAWA Hiroyuki
2009-03-24 8:32 ` Daisuke Nishimura [this message]
2009-03-24 23:57 ` KAMEZAWA Hiroyuki
2009-04-17 6:34 ` Daisuke Nishimura
2009-04-17 6:54 ` KAMEZAWA Hiroyuki
2009-04-17 7:50 ` Daisuke Nishimura
2009-04-17 7:58 ` KAMEZAWA Hiroyuki
2009-04-17 8:12 ` Daisuke Nishimura
2009-04-17 8:13 ` KAMEZAWA Hiroyuki
2009-04-21 2:35 ` Daisuke Nishimura
2009-04-21 2:57 ` KAMEZAWA Hiroyuki
2009-04-21 4:05 ` Daisuke Nishimura
2009-04-17 8:11 ` KAMEZAWA Hiroyuki
2009-03-18 0:08 ` [RFC] memcg: handle swapcache leak Daisuke Nishimura
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=20090324173218.4de33b90.nishimura@mxp.nes.nec.co.jp \
--to=nishimura@mxp.nes.nec.co.jp \
--cc=balbir@linux.vnet.ibm.com \
--cc=d-nishimura@mtf.biglobe.ne.jp \
--cc=hugh@veritas.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-mm@kvack.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