linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] mm: soft-offline: exit with failure for non anonymous thp
@ 2016-01-08  7:24 Naoya Horiguchi
  2016-01-08 20:33 ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Naoya Horiguchi @ 2016-01-08  7:24 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andi Kleen, linux-mm, linux-kernel, Naoya Horiguchi,
	Naoya Horiguchi

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 a case for soft offline code, so let's make it in the same way.

Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
---
 mm/memory-failure.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git v4.4-rc8/mm/memory-failure.c v4.4-rc8_patched/mm/memory-failure.c
index 750b789..30e9085 100644
--- v4.4-rc8/mm/memory-failure.c
+++ v4.4-rc8_patched/mm/memory-failure.c
@@ -1751,9 +1751,11 @@ int soft_offline_page(struct page *page, int flags)
 		return -EBUSY;
 	}
 	if (!PageHuge(page) && PageTransHuge(hpage)) {
-		if (PageAnon(hpage) && unlikely(split_huge_page(hpage))) {
-			pr_info("soft offline: %#lx: failed to split THP\n",
-				pfn);
+		if (!PageAnon(hpage) || unlikely(split_huge_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);
 			if (flags & MF_COUNT_INCREASED)
 				put_hwpoison_page(page);
 			return -EBUSY;
-- 
1.7.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>

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-01-12 23:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-08  7:24 [PATCH v1] mm: soft-offline: exit with failure for non anonymous thp Naoya Horiguchi
2016-01-08 20:33 ` Andrew Morton
2016-01-12  3:10   ` Naoya Horiguchi
2016-01-12  3:10     ` [PATCH v2 1/2] mm: soft-offline: clean up soft_offline_page() Naoya Horiguchi
2016-01-12  3:10     ` [PATCH v2 2/2] mm: soft-offline: exit with failure for non anonymous thp Naoya Horiguchi
2016-01-12 23:49       ` Andrew Morton

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