All of lore.kernel.org
 help / color / mirror / Atom feed
From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
To: linux-mm@kvack.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@kernel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	Anshuman Khandual <khandual@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org,
	Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Subject: [PATCH v1 1/9] mm: hugetlb: prevent reuse of hwpoisoned free hugepages
Date: Thu,  1 Jun 2017 17:16:51 +0900	[thread overview]
Message-ID: <1496305019-5493-2-git-send-email-n-horiguchi@ah.jp.nec.com> (raw)
In-Reply-To: <1496305019-5493-1-git-send-email-n-horiguchi@ah.jp.nec.com>

We no longer use MIGRATE_ISOLATE to prevent reuse of hwpoison hugepages
as we did before. So current dequeue_huge_page_node() doesn't work as
intended because it still uses is_migrate_isolate_page() for this check.
This patch fixes it with PageHWPoison flag.

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

diff --git v4.12-rc3/mm/hugetlb.c v4.12-rc3_patched/mm/hugetlb.c
index e582887..6d6c659 100644
--- v4.12-rc3/mm/hugetlb.c
+++ v4.12-rc3_patched/mm/hugetlb.c
@@ -22,7 +22,6 @@
 #include <linux/rmap.h>
 #include <linux/swap.h>
 #include <linux/swapops.h>
-#include <linux/page-isolation.h>
 #include <linux/jhash.h>
 
 #include <asm/page.h>
@@ -872,7 +871,7 @@ static struct page *dequeue_huge_page_node(struct hstate *h, int nid)
 	struct page *page;
 
 	list_for_each_entry(page, &h->hugepage_freelists[nid], lru)
-		if (!is_migrate_isolate_page(page))
+		if (!PageHWPoison(page))
 			break;
 	/*
 	 * if 'non-isolated free hugepage' not found on the list,
diff --git v4.12-rc3/mm/memory-failure.c v4.12-rc3_patched/mm/memory-failure.c
index 2527dfed..6c1a7c9 100644
--- v4.12-rc3/mm/memory-failure.c
+++ v4.12-rc3_patched/mm/memory-failure.c
@@ -49,7 +49,6 @@
 #include <linux/swap.h>
 #include <linux/backing-dev.h>
 #include <linux/migrate.h>
-#include <linux/page-isolation.h>
 #include <linux/suspend.h>
 #include <linux/slab.h>
 #include <linux/swapops.h>
-- 
2.7.0

WARNING: multiple messages have this Message-ID (diff)
From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
To: linux-mm@kvack.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@kernel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	Anshuman Khandual <khandual@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org,
	Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Subject: [PATCH v1 1/9] mm: hugetlb: prevent reuse of hwpoisoned free hugepages
Date: Thu,  1 Jun 2017 17:16:51 +0900	[thread overview]
Message-ID: <1496305019-5493-2-git-send-email-n-horiguchi@ah.jp.nec.com> (raw)
In-Reply-To: <1496305019-5493-1-git-send-email-n-horiguchi@ah.jp.nec.com>

We no longer use MIGRATE_ISOLATE to prevent reuse of hwpoison hugepages
as we did before. So current dequeue_huge_page_node() doesn't work as
intended because it still uses is_migrate_isolate_page() for this check.
This patch fixes it with PageHWPoison flag.

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

diff --git v4.12-rc3/mm/hugetlb.c v4.12-rc3_patched/mm/hugetlb.c
index e582887..6d6c659 100644
--- v4.12-rc3/mm/hugetlb.c
+++ v4.12-rc3_patched/mm/hugetlb.c
@@ -22,7 +22,6 @@
 #include <linux/rmap.h>
 #include <linux/swap.h>
 #include <linux/swapops.h>
-#include <linux/page-isolation.h>
 #include <linux/jhash.h>
 
 #include <asm/page.h>
@@ -872,7 +871,7 @@ static struct page *dequeue_huge_page_node(struct hstate *h, int nid)
 	struct page *page;
 
 	list_for_each_entry(page, &h->hugepage_freelists[nid], lru)
-		if (!is_migrate_isolate_page(page))
+		if (!PageHWPoison(page))
 			break;
 	/*
 	 * if 'non-isolated free hugepage' not found on the list,
diff --git v4.12-rc3/mm/memory-failure.c v4.12-rc3_patched/mm/memory-failure.c
index 2527dfed..6c1a7c9 100644
--- v4.12-rc3/mm/memory-failure.c
+++ v4.12-rc3_patched/mm/memory-failure.c
@@ -49,7 +49,6 @@
 #include <linux/swap.h>
 #include <linux/backing-dev.h>
 #include <linux/migrate.h>
-#include <linux/page-isolation.h>
 #include <linux/suspend.h>
 #include <linux/slab.h>
 #include <linux/swapops.h>
-- 
2.7.0

--
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:[~2017-06-01  8:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-01  8:16 [PATCH v1 0/9] mm: hwpoison: fixlet for hugetlb migration Naoya Horiguchi
2017-06-01  8:16 ` Naoya Horiguchi
2017-06-01  8:16 ` Naoya Horiguchi [this message]
2017-06-01  8:16   ` [PATCH v1 1/9] mm: hugetlb: prevent reuse of hwpoisoned free hugepages Naoya Horiguchi
2017-06-01  8:16 ` [PATCH v1 2/9] mm: hugetlb: return immediately for hugetlb page in __delete_from_page_cache() Naoya Horiguchi
2017-06-01  8:16   ` Naoya Horiguchi
2017-06-01  8:16 ` [PATCH v1 3/9] mm: hwpoison: change PageHWPoison behavior on hugetlb pages Naoya Horiguchi
2017-06-01  8:16   ` Naoya Horiguchi
2017-06-01  8:16 ` [PATCH v1 4/9] mm: hugetlb: soft-offline: dissolve source hugepage after successful migration Naoya Horiguchi
2017-06-01  8:16   ` Naoya Horiguchi
2017-06-01  8:16 ` [PATCH v1 5/9] mm: soft-offline: dissolve free hugepage if soft-offlined Naoya Horiguchi
2017-06-01  8:16   ` Naoya Horiguchi
2017-06-01  8:16 ` [PATCH v1 6/9] mm: hwpoison: introduce memory_failure_hugetlb() Naoya Horiguchi
2017-06-01  8:16   ` Naoya Horiguchi
2017-06-01  8:16 ` [PATCH v1 7/9] mm: hwpoison: dissolve in-use hugepage in unrecoverable memory error Naoya Horiguchi
2017-06-01  8:16   ` Naoya Horiguchi
2017-06-01  8:16 ` [PATCH v1 8/9] mm: hugetlb: delete dequeue_hwpoisoned_huge_page() Naoya Horiguchi
2017-06-01  8:16   ` Naoya Horiguchi
2017-06-01  8:16 ` [PATCH v1 9/9] mm: hwpoison: introduce idenfity_page_state Naoya Horiguchi
2017-06-01  8:16   ` Naoya Horiguchi

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=1496305019-5493-2-git-send-email-n-horiguchi@ah.jp.nec.com \
    --to=n-horiguchi@ah.jp.nec.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=khandual@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.