From: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>,
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Subject: Re: [PATCH v4] memcg: fix leak on wrong LRU with FUSE
Date: Thu, 10 Mar 2011 15:04:28 +0900 [thread overview]
Message-ID: <20110310150428.f175758c.nishimura@mxp.nes.nec.co.jp> (raw)
In-Reply-To: <20110310144752.289483d4.kamezawa.hiroyu@jp.fujitsu.com>
On Thu, 10 Mar 2011 14:47:52 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> On Thu, 10 Mar 2011 08:36:59 +0900
> KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
>
> > will add. Thank you !
> >
>
> Here is v4 based on feedbacks.
> ==
>
> fs/fuse/dev.c::fuse_try_move_page() does
>
> (1) remove a page by ->steal()
> (2) re-add the page to page cache
> (3) link the page to LRU if it was not on LRU at (1)
>
> This implies the page is _on_ LRU when it's added to radix-tree.
> So, the page is added to memory cgroup while it's on LRU and
> the pave will remain in the old(wrong) memcg.
> By this bug, force_empty()'s LRU scan cannot find the page and
> rmdir() will never ends.
>
> This is the same behavior as SwapCache and needs special care as
> - remove page from LRU before overwrite pc->mem_cgroup.
> - add page to LRU after overwrite pc->mem_cgroup.
>
> This will fixes memcg's rmdir() hang issue with FUSE.
>
> Changelog v3=v4:
> - moved PageLRU() check into the leaf function.
> - added comments
>
> Changelog v2=>v3:
> - fixed double accounting.
>
> Changelog v1=>v2:
> - clean up.
> - cover !PageLRU() by pagevec case.
>
> Reviewed-by: Johannes Weiner <hannes@cmpxchg.org>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
I hope this can fix the original BZ case.
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/ .
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-03-10 6:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-08 4:56 [PATCH v2] " KAMEZAWA Hiroyuki
2011-03-08 9:18 ` Daisuke Nishimura
2011-03-09 6:07 ` KAMEZAWA Hiroyuki
2011-03-09 7:48 ` [PATCH v3] " KAMEZAWA Hiroyuki
2011-03-09 10:00 ` Johannes Weiner
2011-03-09 23:36 ` KAMEZAWA Hiroyuki
2011-03-10 5:47 ` [PATCH v4] " KAMEZAWA Hiroyuki
2011-03-10 6:04 ` Daisuke Nishimura [this message]
2011-03-10 22:20 ` Andrew Morton
2011-03-10 23:45 ` KAMEZAWA Hiroyuki
2011-03-11 0:01 ` Andrew Morton
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=20110310150428.f175758c.nishimura@mxp.nes.nec.co.jp \
--to=nishimura@mxp.nes.nec.co.jp \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=hannes@cmpxchg.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--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