aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory-failure.c
diff options
context:
space:
mode:
authorWu Fengguang <fengguang.wu@intel.com>2009-12-16 06:19:58 -0500
committerAndi Kleen <ak@linux.intel.com>2009-12-16 06:19:58 -0500
commitd95ea51e3a7e9ee051d19f1dd283ca61d1aa5ec6 (patch)
treec7bbafb931c9023dfaf1db8e4882a7154dc88ba0 /mm/memory-failure.c
parent847ce401df392b0704369fd3f75df614ac1414b4 (diff)
HWPOISON: make semantics of IGNORED/DELAYED clear
Change semantics for - IGNORED: not handled; it may well be _unsafe_ - DELAYED: to be handled later; it is _safe_ With this change, - IGNORED/FAILED mean (maybe) Error - DELAYED/RECOVERED mean Success Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'mm/memory-failure.c')
-rw-r--r--mm/memory-failure.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index ed6e91c87a54..fd1ac1537f06 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -336,16 +336,16 @@ static void collect_procs(struct page *page, struct list_head *tokill)
336 */ 336 */
337 337
338enum outcome { 338enum outcome {
339 FAILED, /* Error handling failed */ 339 IGNORED, /* Error: cannot be handled */
340 FAILED, /* Error: handling failed */
340 DELAYED, /* Will be handled later */ 341 DELAYED, /* Will be handled later */
341 IGNORED, /* Error safely ignored */
342 RECOVERED, /* Successfully recovered */ 342 RECOVERED, /* Successfully recovered */
343}; 343};
344 344
345static const char *action_name[] = { 345static const char *action_name[] = {
346 [IGNORED] = "Ignored",
346 [FAILED] = "Failed", 347 [FAILED] = "Failed",
347 [DELAYED] = "Delayed", 348 [DELAYED] = "Delayed",
348 [IGNORED] = "Ignored",
349 [RECOVERED] = "Recovered", 349 [RECOVERED] = "Recovered",
350}; 350};
351 351
@@ -380,14 +380,6 @@ static int delete_from_lru_cache(struct page *p)
380 */ 380 */
381static int me_kernel(struct page *p, unsigned long pfn) 381static int me_kernel(struct page *p, unsigned long pfn)
382{ 382{
383 return DELAYED;
384}
385
386/*
387 * Already poisoned page.
388 */
389static int me_ignore(struct page *p, unsigned long pfn)
390{
391 return IGNORED; 383 return IGNORED;
392} 384}
393 385
@@ -604,7 +596,7 @@ static struct page_state {
604 char *msg; 596 char *msg;
605 int (*action)(struct page *p, unsigned long pfn); 597 int (*action)(struct page *p, unsigned long pfn);
606} error_states[] = { 598} error_states[] = {
607 { reserved, reserved, "reserved kernel", me_ignore }, 599 { reserved, reserved, "reserved kernel", me_kernel },
608 /* 600 /*
609 * free pages are specially detected outside this table: 601 * free pages are specially detected outside this table:
610 * PG_buddy pages only make a small fraction of all free pages. 602 * PG_buddy pages only make a small fraction of all free pages.
@@ -788,7 +780,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
788 780
789 p = pfn_to_page(pfn); 781 p = pfn_to_page(pfn);
790 if (TestSetPageHWPoison(p)) { 782 if (TestSetPageHWPoison(p)) {
791 action_result(pfn, "already hardware poisoned", IGNORED); 783 printk(KERN_ERR "MCE %#lx: already hardware poisoned\n", pfn);
792 return 0; 784 return 0;
793 } 785 }
794 786
@@ -843,7 +835,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
843 * unpoison always clear PG_hwpoison inside page lock 835 * unpoison always clear PG_hwpoison inside page lock
844 */ 836 */
845 if (!PageHWPoison(p)) { 837 if (!PageHWPoison(p)) {
846 action_result(pfn, "unpoisoned", IGNORED); 838 printk(KERN_ERR "MCE %#lx: just unpoisoned\n", pfn);
847 res = 0; 839 res = 0;
848 goto out; 840 goto out;
849 } 841 }
@@ -865,7 +857,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
865 */ 857 */
866 if (PageLRU(p) && !PageSwapCache(p) && p->mapping == NULL) { 858 if (PageLRU(p) && !PageSwapCache(p) && p->mapping == NULL) {
867 action_result(pfn, "already truncated LRU", IGNORED); 859 action_result(pfn, "already truncated LRU", IGNORED);
868 res = 0; 860 res = -EBUSY;
869 goto out; 861 goto out;
870 } 862 }
871 863