linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wanpeng Li <liwanp@linux.vnet.ibm.com>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Andi Kleen <andi@firstfloor.org>,
	Fengguang Wu <fengguang.wu@intel.com>,
	Tony Luck <tony.luck@intel.com>,
	gong.chen@linux.intel.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwpoison: always unset MIGRATE_ISOLATE before returning from soft_offline_page()
Date: Fri, 23 Aug 2013 08:24:00 +0800	[thread overview]
Message-ID: <20130823002400.GA25610@hacker.(null)> (raw)
In-Reply-To: <1377199247-2kdx6aoc-mutt-n-horiguchi@ah.jp.nec.com>

On Thu, Aug 22, 2013 at 03:20:47PM -0400, Naoya Horiguchi wrote:
>Soft offline code expects that MIGRATE_ISOLATE is set on the target page
>only during soft offlining work. But currenly it doesn't work as expected
>when get_any_page() fails and returns negative value. In the result, end
>users can have unexpectedly isolated pages. This patch just fixes it.
>

Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>

>Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
>---
> mm/memory-failure.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/mm/memory-failure.c b/mm/memory-failure.c
>index af6f61c..1cb3b7d 100644
>--- a/mm/memory-failure.c
>+++ b/mm/memory-failure.c
>@@ -1550,7 +1550,7 @@ int soft_offline_page(struct page *page, int flags)
>
> 	ret = get_any_page(page, pfn, flags);
> 	if (ret < 0)
>-		return ret;
>+		goto unset;
> 	if (ret) { /* for in-use pages */
> 		if (PageHuge(page))
> 			ret = soft_offline_huge_page(page, flags);
>@@ -1567,6 +1567,7 @@ int soft_offline_page(struct page *page, int flags)
> 			atomic_long_inc(&num_poisoned_pages);
> 		}
> 	}
>+unset:
> 	unset_migratetype_isolate(page, MIGRATE_MOVABLE);
> 	return ret;
> }
>-- 
>1.8.3.1
>
>--
>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>

--
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>

  reply	other threads:[~2013-08-23  0:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-22 19:20 [PATCH] hwpoison: always unset MIGRATE_ISOLATE before returning from soft_offline_page() Naoya Horiguchi
2013-08-23  0:24 ` Wanpeng Li [this message]
2013-08-23  0:24 ` Wanpeng Li

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='20130823002400.GA25610@hacker.(null)' \
    --to=liwanp@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=fengguang.wu@intel.com \
    --cc=gong.chen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=tony.luck@intel.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;
as well as URLs for NNTP newsgroup(s).