Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1307926

Re: [PATCH v2 2/2] mm: soft-offline: exit with failure for non anonymous thp

From Andrew Morton <akpm@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/2] mm: soft-offline: exit with failure for non anonymous thp
Date 2016-01-13 01:00 +0100
Message-ID <qQh10-88E-13@gated-at.bofh.it> (permalink)
References <qOLZg-3xd-9@gated-at.bofh.it> <qPXEZ-3xb-9@gated-at.bofh.it> <qPXEZ-3xb-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 12 Jan 2016 12:10:45 +0900 Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> wrote:

> Currently memory_failure() doesn't handle non anonymous thp case, because we
> can hardly expect the error handling to be successful, and it can just hit
> some corner case which results in BUG_ON or something severe like that.
> This is also the case for soft offline code, so let's make it in the same way.
> 
> Orignal code has a MF_COUNT_INCREASED check before put_hwpoison_page(), but
> it's unnecessary because get_any_page() is already called when running on
> this code, which takes a refcount of the target page regardress of the flag.
> So this patch also removes it.
> 
> ...
>
> --- next-20160111/mm/memory-failure.c
> +++ next-20160111_patched/mm/memory-failure.c
> @@ -1691,16 +1691,16 @@ static int soft_offline_in_use_page(struct page *page, int flags)
>  
>  	if (!PageHuge(page) && PageTransHuge(hpage)) {
>  		lock_page(hpage);
> -		ret = split_huge_page(hpage);
> -		unlock_page(hpage);
> -		if (unlikely(ret || PageTransCompound(page) ||
> -			     !PageAnon(page))) {
> -			pr_info("soft offline: %#lx: failed to split THP\n",
> -				page_to_pfn(page));
> -			if (flags & MF_COUNT_INCREASED)
> -				put_hwpoison_page(hpage);
> +		if (!PageAnon(hpage) || unlikely(split_huge_page(hpage))) {
> +			unlock_page(hpage);
> +			if (!PageAnon(hpage))
> +				pr_info("soft offline: %#lx: non anonymous thp\n", pfn);
> +			else
> +				pr_info("soft offline: %#lx: thp split failed\n", pfn);
> +			put_hwpoison_page(hpage);
>  			return -EBUSY;
>  		}

hm, what happened there.

mm/memory-failure.c: In function 'soft_offline_in_use_page':
mm/memory-failure.c:1697: error: 'pfn' undeclared (first use in this function)
mm/memory-failure.c:1697: error: (Each undeclared identifier is reported only once
mm/memory-failure.c:1697: error: for each function it appears in.)

--- a/mm/memory-failure.c~mm-soft-offline-exit-with-failure-for-non-anonymous-thp-fix
+++ a/mm/memory-failure.c
@@ -1694,9 +1694,9 @@ static int soft_offline_in_use_page(stru
 		if (!PageAnon(hpage) || unlikely(split_huge_page(hpage))) {
 			unlock_page(hpage);
 			if (!PageAnon(hpage))
-				pr_info("soft offline: %#lx: non anonymous thp\n", pfn);
+				pr_info("soft offline: %#lx: non anonymous thp\n", page_to_pfn(page));
 			else
-				pr_info("soft offline: %#lx: thp split failed\n", pfn);
+				pr_info("soft offline: %#lx: thp split failed\n", page_to_pfn(page));
 			put_hwpoison_page(hpage);
 			return -EBUSY;
 		}
_

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v1] mm: soft-offline: exit with failure for non anonymous thp Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> - 2016-01-08 08:30 +0100
  Re: [PATCH v1] mm: soft-offline: exit with failure for non  anonymous thp Andrew Morton <akpm@linux-foundation.org> - 2016-01-08 21:40 +0100
    Re: [PATCH v1] mm: soft-offline: exit with failure for non anonymous thp Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> - 2016-01-12 04:20 +0100
      [PATCH v2 1/2] mm: soft-offline: clean up soft_offline_page() Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> - 2016-01-12 04:20 +0100
      [PATCH v2 2/2] mm: soft-offline: exit with failure for non anonymous thp Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> - 2016-01-12 04:20 +0100
        Re: [PATCH v2 2/2] mm: soft-offline: exit with failure for non  anonymous thp Andrew Morton <akpm@linux-foundation.org> - 2016-01-13 01:00 +0100

csiph-web