aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory-failure.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory-failure.c')
-rw-r--r--mm/memory-failure.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 46ab2c044b0e..548fbd70f026 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -203,7 +203,7 @@ static int kill_proc_ao(struct task_struct *t, unsigned long addr, int trapno,
203#ifdef __ARCH_SI_TRAPNO 203#ifdef __ARCH_SI_TRAPNO
204 si.si_trapno = trapno; 204 si.si_trapno = trapno;
205#endif 205#endif
206 si.si_addr_lsb = compound_order(compound_head(page)) + PAGE_SHIFT; 206 si.si_addr_lsb = compound_trans_order(compound_head(page)) + PAGE_SHIFT;
207 /* 207 /*
208 * Don't use force here, it's convenient if the signal 208 * Don't use force here, it's convenient if the signal
209 * can be temporarily blocked. 209 * can be temporarily blocked.
@@ -386,6 +386,8 @@ static void collect_procs_anon(struct page *page, struct list_head *to_kill,
386 struct task_struct *tsk; 386 struct task_struct *tsk;
387 struct anon_vma *av; 387 struct anon_vma *av;
388 388
389 if (!PageHuge(page) && unlikely(split_huge_page(page)))
390 return;
389 read_lock(&tasklist_lock); 391 read_lock(&tasklist_lock);
390 av = page_lock_anon_vma(page); 392 av = page_lock_anon_vma(page);
391 if (av == NULL) /* Not actually mapped anymore */ 393 if (av == NULL) /* Not actually mapped anymore */
@@ -928,7 +930,7 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn,
928static void set_page_hwpoison_huge_page(struct page *hpage) 930static void set_page_hwpoison_huge_page(struct page *hpage)
929{ 931{
930 int i; 932 int i;
931 int nr_pages = 1 << compound_order(hpage); 933 int nr_pages = 1 << compound_trans_order(hpage);
932 for (i = 0; i < nr_pages; i++) 934 for (i = 0; i < nr_pages; i++)
933 SetPageHWPoison(hpage + i); 935 SetPageHWPoison(hpage + i);
934} 936}
@@ -936,7 +938,7 @@ static void set_page_hwpoison_huge_page(struct page *hpage)
936static void clear_page_hwpoison_huge_page(struct page *hpage) 938static void clear_page_hwpoison_huge_page(struct page *hpage)
937{ 939{
938 int i; 940 int i;
939 int nr_pages = 1 << compound_order(hpage); 941 int nr_pages = 1 << compound_trans_order(hpage);
940 for (i = 0; i < nr_pages; i++) 942 for (i = 0; i < nr_pages; i++)
941 ClearPageHWPoison(hpage + i); 943 ClearPageHWPoison(hpage + i);
942} 944}
@@ -966,7 +968,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
966 return 0; 968 return 0;
967 } 969 }
968 970
969 nr_pages = 1 << compound_order(hpage); 971 nr_pages = 1 << compound_trans_order(hpage);
970 atomic_long_add(nr_pages, &mce_bad_pages); 972 atomic_long_add(nr_pages, &mce_bad_pages);
971 973
972 /* 974 /*
@@ -1164,7 +1166,7 @@ int unpoison_memory(unsigned long pfn)
1164 return 0; 1166 return 0;
1165 } 1167 }
1166 1168
1167 nr_pages = 1 << compound_order(page); 1169 nr_pages = 1 << compound_trans_order(page);
1168 1170
1169 if (!get_page_unless_zero(page)) { 1171 if (!get_page_unless_zero(page)) {
1170 /* 1172 /*
@@ -1290,9 +1292,10 @@ static int soft_offline_huge_page(struct page *page, int flags)
1290 /* Keep page count to indicate a given hugepage is isolated. */ 1292 /* Keep page count to indicate a given hugepage is isolated. */
1291 1293
1292 list_add(&hpage->lru, &pagelist); 1294 list_add(&hpage->lru, &pagelist);
1293 ret = migrate_huge_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL, 0); 1295 ret = migrate_huge_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL, 0,
1296 true);
1294 if (ret) { 1297 if (ret) {
1295 putback_lru_pages(&pagelist); 1298 putback_lru_pages(&pagelist);
1296 pr_debug("soft offline: %#lx: migration failed %d, type %lx\n", 1299 pr_debug("soft offline: %#lx: migration failed %d, type %lx\n",
1297 pfn, ret, page->flags); 1300 pfn, ret, page->flags);
1298 if (ret > 0) 1301 if (ret > 0)
@@ -1301,7 +1304,7 @@ static int soft_offline_huge_page(struct page *page, int flags)
1301 } 1304 }
1302done: 1305done:
1303 if (!PageHWPoison(hpage)) 1306 if (!PageHWPoison(hpage))
1304 atomic_long_add(1 << compound_order(hpage), &mce_bad_pages); 1307 atomic_long_add(1 << compound_trans_order(hpage), &mce_bad_pages);
1305 set_page_hwpoison_huge_page(hpage); 1308 set_page_hwpoison_huge_page(hpage);
1306 dequeue_hwpoisoned_huge_page(hpage); 1309 dequeue_hwpoisoned_huge_page(hpage);
1307 /* keep elevated page count for bad page */ 1310 /* keep elevated page count for bad page */
@@ -1413,7 +1416,8 @@ int soft_offline_page(struct page *page, int flags)
1413 LIST_HEAD(pagelist); 1416 LIST_HEAD(pagelist);
1414 1417
1415 list_add(&page->lru, &pagelist); 1418 list_add(&page->lru, &pagelist);
1416 ret = migrate_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL, 0); 1419 ret = migrate_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL,
1420 0, true);
1417 if (ret) { 1421 if (ret) {
1418 pr_info("soft offline: %#lx: migration failed %d, type %lx\n", 1422 pr_info("soft offline: %#lx: migration failed %d, type %lx\n",
1419 pfn, ret, page->flags); 1423 pfn, ret, page->flags);