All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <20160404053830.GA7042@bbox>

diff --git a/a/1.txt b/N1/1.txt
index 5725e72..46b613f 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -127,3 +127,45 @@ Naoya, I wrote up the patch but hard to say I write up correct description.
 Could you review this?
 
 Thankks.
+
+>From 916b0d5960169e93d1fa3c8b7bdb03fe2b86b455 Mon Sep 17 00:00:00 2001
+From: Minchan Kim <minchan@kernel.org>
+Date: Mon, 4 Apr 2016 14:26:30 +0900
+Subject: [PATCH] mm/hwpoison: fix wrong num_poisoned_pages account
+
+Currently, migartion code increses num_poisoned_pages on *failed*
+migration page as well as successfully migrated one at the trial
+of memory-failture. It will make the stat wrong.
+As well, it marks the page as PG_HWPoison even if the migration
+trial failed. It would make we cannot recover the corrupted page
+using memory-failure facility.
+
+This patches fixes it.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Minchan Kim <minchan@kernel.org>
+---
+ mm/migrate.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/mm/migrate.c b/mm/migrate.c
+index 6c822a7b27e0..f9dfb18a4eba 100644
+--- a/mm/migrate.c
++++ b/mm/migrate.c
+@@ -975,7 +975,13 @@ static ICE_noinline int unmap_and_move(new_page_t get_new_page,
+ 		dec_zone_page_state(page, NR_ISOLATED_ANON +
+ 				page_is_file_cache(page));
+ 		/* Soft-offlined page shouldn't go through lru cache list */
+-		if (reason == MR_MEMORY_FAILURE) {
++		if (reason == MR_MEMORY_FAILURE && rc == MIGRATEPAGE_SUCCESS) {
++			/*
++			 * With this release, we free successfully migrated
++			 * page and set PG_HWPoison on just freed page
++			 * intentionally. Although it's rather weird, it's how
++			 * HWPoison flag works at the moment.
++			 */
+ 			put_page(page);
+ 			if (!test_set_page_hwpoison(page))
+ 				num_poisoned_pages_inc();
+-- 
+1.9.1
diff --git a/a/content_digest b/N1/content_digest
index a53c8d5..12aa332 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -152,6 +152,48 @@
  "Naoya, I wrote up the patch but hard to say I write up correct description.\n"
  "Could you review this?\n"
  "\n"
- Thankks.
+ "Thankks.\n"
+ "\n"
+ ">From 916b0d5960169e93d1fa3c8b7bdb03fe2b86b455 Mon Sep 17 00:00:00 2001\n"
+ "From: Minchan Kim <minchan@kernel.org>\n"
+ "Date: Mon, 4 Apr 2016 14:26:30 +0900\n"
+ "Subject: [PATCH] mm/hwpoison: fix wrong num_poisoned_pages account\n"
+ "\n"
+ "Currently, migartion code increses num_poisoned_pages on *failed*\n"
+ "migration page as well as successfully migrated one at the trial\n"
+ "of memory-failture. It will make the stat wrong.\n"
+ "As well, it marks the page as PG_HWPoison even if the migration\n"
+ "trial failed. It would make we cannot recover the corrupted page\n"
+ "using memory-failure facility.\n"
+ "\n"
+ "This patches fixes it.\n"
+ "\n"
+ "Cc: stable@vger.kernel.org\n"
+ "Signed-off-by: Minchan Kim <minchan@kernel.org>\n"
+ "---\n"
+ " mm/migrate.c | 8 +++++++-\n"
+ " 1 file changed, 7 insertions(+), 1 deletion(-)\n"
+ "\n"
+ "diff --git a/mm/migrate.c b/mm/migrate.c\n"
+ "index 6c822a7b27e0..f9dfb18a4eba 100644\n"
+ "--- a/mm/migrate.c\n"
+ "+++ b/mm/migrate.c\n"
+ "@@ -975,7 +975,13 @@ static ICE_noinline int unmap_and_move(new_page_t get_new_page,\n"
+ " \t\tdec_zone_page_state(page, NR_ISOLATED_ANON +\n"
+ " \t\t\t\tpage_is_file_cache(page));\n"
+ " \t\t/* Soft-offlined page shouldn't go through lru cache list */\n"
+ "-\t\tif (reason == MR_MEMORY_FAILURE) {\n"
+ "+\t\tif (reason == MR_MEMORY_FAILURE && rc == MIGRATEPAGE_SUCCESS) {\n"
+ "+\t\t\t/*\n"
+ "+\t\t\t * With this release, we free successfully migrated\n"
+ "+\t\t\t * page and set PG_HWPoison on just freed page\n"
+ "+\t\t\t * intentionally. Although it's rather weird, it's how\n"
+ "+\t\t\t * HWPoison flag works at the moment.\n"
+ "+\t\t\t */\n"
+ " \t\t\tput_page(page);\n"
+ " \t\t\tif (!test_set_page_hwpoison(page))\n"
+ " \t\t\t\tnum_poisoned_pages_inc();\n"
+ "-- \n"
+ 1.9.1
 
-a8e257a8440cdd02f883278237048d42007995c71ea0a48e8e603e742fd2807d
+e321c0f52f4e958feeb8e501e136d5bd5a7a953fa33eeebfaab05acfa1fd3588

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.