All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <20130604154500.GA5664@gmail.com>

diff --git a/a/2.txt b/N1/2.txt
index 8b13789..acf4c6f 100644
--- a/a/2.txt
+++ b/N1/2.txt
@@ -1 +1,51 @@
+>From 22d00055bdd4d88eb01958828e4c0121231a9e01 Mon Sep 17 00:00:00 2001
+From: Jerome Glisse <jglisse@redhat.com>
+Date: Tue, 4 Jun 2013 11:34:14 -0400
+Subject: [PATCH] mm: properly handle fault on huge page migration
 
+When huge page is being migrated it's pmd is non zero but does not have
+any of the huge pmd flags set. It's a swap entry pmd. The handle_mm_fault
+never check for this case and thus if a fault happen in the huge page
+range while it's being migrated handle_mm_fault will interpret badly the
+pmd.
+
+Signed-off-by: Jerome Glisse <jglisse@redhat.com>
+---
+ mm/memory.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/mm/memory.c b/mm/memory.c
+index 6dc1882..e2a039c 100644
+--- a/mm/memory.c
++++ b/mm/memory.c
+@@ -3793,6 +3793,7 @@ retry:
+ 							  pmd, flags);
+ 	} else {
+ 		pmd_t orig_pmd = *pmd;
++		swp_entry_t entry;
+ 		int ret;
+ 
+ 		barrier();
+@@ -3829,6 +3830,20 @@ retry:
+ 
+ 			return 0;
+ 		}
++
++		swp_entry_t entry = pte_to_swp_entry((pte_t)orig_pmd);
++		if (unlikely(non_swap_entry(entry))) {
++			if (is_migration_entry(entry)) {
++				migration_entry_wait(mm, pmd, address);
++				/* Retry the fault */
++				return 0;
++			} else if (is_hwpoison_entry(entry)) {
++				return VM_FAULT_HWPOISON;
++			} else {
++				/* Something else is wrong invalid pmd print it ? */
++				return VM_FAULT_SIGBUS;
++			}
++		}
+ 	}
+ 
+ 	if (pmd_numa(*pmd))
+-- 
+1.7.11.7
diff --git a/a/content_digest b/N1/content_digest
index 7fa50d3..792ad5a 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -92,5 +92,56 @@
  "\01:2\0"
  "fn\00001-mm-properly-handle-fault-on-huge-page-migration.patch\0"
  "b\0"
+ ">From 22d00055bdd4d88eb01958828e4c0121231a9e01 Mon Sep 17 00:00:00 2001\n"
+ "From: Jerome Glisse <jglisse@redhat.com>\n"
+ "Date: Tue, 4 Jun 2013 11:34:14 -0400\n"
+ "Subject: [PATCH] mm: properly handle fault on huge page migration\n"
+ "\n"
+ "When huge page is being migrated it's pmd is non zero but does not have\n"
+ "any of the huge pmd flags set. It's a swap entry pmd. The handle_mm_fault\n"
+ "never check for this case and thus if a fault happen in the huge page\n"
+ "range while it's being migrated handle_mm_fault will interpret badly the\n"
+ "pmd.\n"
+ "\n"
+ "Signed-off-by: Jerome Glisse <jglisse@redhat.com>\n"
+ "---\n"
+ " mm/memory.c | 15 +++++++++++++++\n"
+ " 1 file changed, 15 insertions(+)\n"
+ "\n"
+ "diff --git a/mm/memory.c b/mm/memory.c\n"
+ "index 6dc1882..e2a039c 100644\n"
+ "--- a/mm/memory.c\n"
+ "+++ b/mm/memory.c\n"
+ "@@ -3793,6 +3793,7 @@ retry:\n"
+ " \t\t\t\t\t\t\t  pmd, flags);\n"
+ " \t} else {\n"
+ " \t\tpmd_t orig_pmd = *pmd;\n"
+ "+\t\tswp_entry_t entry;\n"
+ " \t\tint ret;\n"
+ " \n"
+ " \t\tbarrier();\n"
+ "@@ -3829,6 +3830,20 @@ retry:\n"
+ " \n"
+ " \t\t\treturn 0;\n"
+ " \t\t}\n"
+ "+\n"
+ "+\t\tswp_entry_t entry = pte_to_swp_entry((pte_t)orig_pmd);\n"
+ "+\t\tif (unlikely(non_swap_entry(entry))) {\n"
+ "+\t\t\tif (is_migration_entry(entry)) {\n"
+ "+\t\t\t\tmigration_entry_wait(mm, pmd, address);\n"
+ "+\t\t\t\t/* Retry the fault */\n"
+ "+\t\t\t\treturn 0;\n"
+ "+\t\t\t} else if (is_hwpoison_entry(entry)) {\n"
+ "+\t\t\t\treturn VM_FAULT_HWPOISON;\n"
+ "+\t\t\t} else {\n"
+ "+\t\t\t\t/* Something else is wrong invalid pmd print it ? */\n"
+ "+\t\t\t\treturn VM_FAULT_SIGBUS;\n"
+ "+\t\t\t}\n"
+ "+\t\t}\n"
+ " \t}\n"
+ " \n"
+ " \tif (pmd_numa(*pmd))\n"
+ "-- \n"
+ 1.7.11.7
 
-a5c0d571eee64301ae6e0742aa7fc94cb0d530fea7ba435bfe9a073819c522a8
+8ec689f139b4a646033eb27887168c10c042c833214fd2d8caecff4905a7c759

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.