From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
To: gong.chen@linux.intel.com
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
Andi Kleen <andi@firstfloor.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/memory-failure.c: fix memory leak in successful soft offlining
Date: Mon, 01 Jul 2013 11:25:03 -0400 [thread overview]
Message-ID: <1372692303-56f0gltk-mutt-n-horiguchi@ah.jp.nec.com> (raw)
In-Reply-To: <20130701091355.GA14444@gchen.bj.intel.com>
On Mon, Jul 01, 2013 at 05:13:55AM -0400, Chen Gong wrote:
> On Fri, May 17, 2013 at 12:18:02PM -0400, Naoya Horiguchi wrote:
> > Date: Fri, 17 May 2013 12:18:02 -0400
> > From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> > To: linux-mm@kvack.org
> > Cc: Andrew Morton <akpm@linux-foundation.org>, Andi Kleen
> > <andi@firstfloor.org>, linux-kernel@vger.kernel.org, Naoya Horiguchi
> > <n-horiguchi@ah.jp.nec.com>
> > Subject: [PATCH] mm/memory-failure.c: fix memory leak in successful soft
> > offlining
> >
> > After a successful page migration by soft offlining, the source page is
> > not properly freed and it's never reusable even if we unpoison it afterward.
> >
> > This is caused by the race between freeing page and setting PG_hwpoison.
> > In successful soft offlining, the source page is put (and the refcount
> > becomes 0) by putback_lru_page() in unmap_and_move(), where it's linked to
> > pagevec and actual freeing back to buddy is delayed. So if PG_hwpoison is
> > set for the page before freeing, the freeing does not functions as expected
> > (in such case freeing aborts in free_pages_prepare() check.)
> >
> > This patch tries to make sure to free the source page before setting
> > PG_hwpoison on it. To avoid reallocating, the page keeps MIGRATE_ISOLATE
> > until after setting PG_hwpoison.
> >
> > This patch also removes obsolete comments about "keeping elevated refcount"
> > because what they say is not true. Unlike memory_failure(), soft_offline_page()
> > uses no special page isolation code, and the soft-offlined pages have no
> > difference from buddy pages except PG_hwpoison. So no need to keep refcount
> > elevated.
> >
> > Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> > ---
...
> Hi, Naoya
>
> What happens about this patch? It looks find to me but not merged yet.
> If something I missed, would you please tell me again?
Hello Gong,
It's already on mmotm, so I hope Andrew will push it in this merge window
(just opened yesterday.)
Thanks,
Naoya Horiguchi
--
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>
prev parent reply other threads:[~2013-07-01 15:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-17 16:18 Naoya Horiguchi
2013-07-01 9:13 ` Chen Gong
2013-07-01 15:25 ` Naoya Horiguchi [this message]
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=1372692303-56f0gltk-mutt-n-horiguchi@ah.jp.nec.com \
--to=n-horiguchi@ah.jp.nec.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=gong.chen@linux.intel.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