aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory-failure.c
diff options
context:
space:
mode:
authorXishi Qiu <qiuxishi@huawei.com>2013-02-22 19:34:02 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-23 20:50:15 -0500
commit293c07e31ab5a0b8df8c19b2a9e5c6fa30308849 (patch)
tree753affc0e179b7de49c03dc58d7d75f34ffe4e62 /mm/memory-failure.c
parentfa8dd8a92dccc1b29cefd7f51334285d6ed35281 (diff)
memory-failure: use num_poisoned_pages instead of mce_bad_pages
Since MCE is an x86 concept, and this code is in mm/, it would be better to use the name num_poisoned_pages instead of mce_bad_pages. [akpm@linux-foundation.org: fix mm/sparse.c] Signed-off-by: Xishi Qiu <qiuxishi@huawei.com> Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Suggested-by: Borislav Petkov <bp@alien8.de> Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Cc: Andi Kleen <andi@firstfloor.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory-failure.c')
-rw-r--r--mm/memory-failure.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index f4c9fa1149e2..c95e19af510b 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -61,7 +61,7 @@ int sysctl_memory_failure_early_kill __read_mostly = 0;
61 61
62int sysctl_memory_failure_recovery __read_mostly = 1; 62int sysctl_memory_failure_recovery __read_mostly = 1;
63 63
64atomic_long_t mce_bad_pages __read_mostly = ATOMIC_LONG_INIT(0); 64atomic_long_t num_poisoned_pages __read_mostly = ATOMIC_LONG_INIT(0);
65 65
66#if defined(CONFIG_HWPOISON_INJECT) || defined(CONFIG_HWPOISON_INJECT_MODULE) 66#if defined(CONFIG_HWPOISON_INJECT) || defined(CONFIG_HWPOISON_INJECT_MODULE)
67 67
@@ -1040,7 +1040,7 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
1040 } 1040 }
1041 1041
1042 nr_pages = 1 << compound_trans_order(hpage); 1042 nr_pages = 1 << compound_trans_order(hpage);
1043 atomic_long_add(nr_pages, &mce_bad_pages); 1043 atomic_long_add(nr_pages, &num_poisoned_pages);
1044 1044
1045 /* 1045 /*
1046 * We need/can do nothing about count=0 pages. 1046 * We need/can do nothing about count=0 pages.
@@ -1070,7 +1070,7 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
1070 if (!PageHWPoison(hpage) 1070 if (!PageHWPoison(hpage)
1071 || (hwpoison_filter(p) && TestClearPageHWPoison(p)) 1071 || (hwpoison_filter(p) && TestClearPageHWPoison(p))
1072 || (p != hpage && TestSetPageHWPoison(hpage))) { 1072 || (p != hpage && TestSetPageHWPoison(hpage))) {
1073 atomic_long_sub(nr_pages, &mce_bad_pages); 1073 atomic_long_sub(nr_pages, &num_poisoned_pages);
1074 return 0; 1074 return 0;
1075 } 1075 }
1076 set_page_hwpoison_huge_page(hpage); 1076 set_page_hwpoison_huge_page(hpage);
@@ -1128,7 +1128,7 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
1128 } 1128 }
1129 if (hwpoison_filter(p)) { 1129 if (hwpoison_filter(p)) {
1130 if (TestClearPageHWPoison(p)) 1130 if (TestClearPageHWPoison(p))
1131 atomic_long_sub(nr_pages, &mce_bad_pages); 1131 atomic_long_sub(nr_pages, &num_poisoned_pages);
1132 unlock_page(hpage); 1132 unlock_page(hpage);
1133 put_page(hpage); 1133 put_page(hpage);
1134 return 0; 1134 return 0;
@@ -1323,7 +1323,7 @@ int unpoison_memory(unsigned long pfn)
1323 return 0; 1323 return 0;
1324 } 1324 }
1325 if (TestClearPageHWPoison(p)) 1325 if (TestClearPageHWPoison(p))
1326 atomic_long_sub(nr_pages, &mce_bad_pages); 1326 atomic_long_sub(nr_pages, &num_poisoned_pages);
1327 pr_info("MCE: Software-unpoisoned free page %#lx\n", pfn); 1327 pr_info("MCE: Software-unpoisoned free page %#lx\n", pfn);
1328 return 0; 1328 return 0;
1329 } 1329 }
@@ -1337,7 +1337,7 @@ int unpoison_memory(unsigned long pfn)
1337 */ 1337 */
1338 if (TestClearPageHWPoison(page)) { 1338 if (TestClearPageHWPoison(page)) {
1339 pr_info("MCE: Software-unpoisoned page %#lx\n", pfn); 1339 pr_info("MCE: Software-unpoisoned page %#lx\n", pfn);
1340 atomic_long_sub(nr_pages, &mce_bad_pages); 1340 atomic_long_sub(nr_pages, &num_poisoned_pages);
1341 freeit = 1; 1341 freeit = 1;
1342 if (PageHuge(page)) 1342 if (PageHuge(page))
1343 clear_page_hwpoison_huge_page(page); 1343 clear_page_hwpoison_huge_page(page);
@@ -1442,7 +1442,7 @@ static int soft_offline_huge_page(struct page *page, int flags)
1442 } 1442 }
1443done: 1443done:
1444 /* keep elevated page count for bad page */ 1444 /* keep elevated page count for bad page */
1445 atomic_long_add(1 << compound_trans_order(hpage), &mce_bad_pages); 1445 atomic_long_add(1 << compound_trans_order(hpage), &num_poisoned_pages);
1446 set_page_hwpoison_huge_page(hpage); 1446 set_page_hwpoison_huge_page(hpage);
1447 dequeue_hwpoisoned_huge_page(hpage); 1447 dequeue_hwpoisoned_huge_page(hpage);
1448out: 1448out:
@@ -1585,7 +1585,7 @@ int soft_offline_page(struct page *page, int flags)
1585 1585
1586done: 1586done:
1587 /* keep elevated page count for bad page */ 1587 /* keep elevated page count for bad page */
1588 atomic_long_inc(&mce_bad_pages); 1588 atomic_long_inc(&num_poisoned_pages);
1589 SetPageHWPoison(page); 1589 SetPageHWPoison(page);
1590out: 1590out:
1591 return ret; 1591 return ret;