Commit d95ea51e3a7e9ee051d19f1dd283ca61d1aa5ec6

Authored by Wu Fengguang
Committed by Andi Kleen
1 parent 847ce401df

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>

Showing 1 changed file with 7 additions and 15 deletions Side-by-side Diff

... ... @@ -336,16 +336,16 @@
336 336 */
337 337  
338 338 enum outcome {
339   - FAILED, /* Error handling failed */
  339 + IGNORED, /* Error: cannot be handled */
  340 + FAILED, /* Error: handling failed */
340 341 DELAYED, /* Will be handled later */
341   - IGNORED, /* Error safely ignored */
342 342 RECOVERED, /* Successfully recovered */
343 343 };
344 344  
345 345 static const char *action_name[] = {
  346 + [IGNORED] = "Ignored",
346 347 [FAILED] = "Failed",
347 348 [DELAYED] = "Delayed",
348   - [IGNORED] = "Ignored",
349 349 [RECOVERED] = "Recovered",
350 350 };
351 351  
... ... @@ -380,14 +380,6 @@
380 380 */
381 381 static int me_kernel(struct page *p, unsigned long pfn)
382 382 {
383   - return DELAYED;
384   -}
385   -
386   -/*
387   - * Already poisoned page.
388   - */
389   -static int me_ignore(struct page *p, unsigned long pfn)
390   -{
391 383 return IGNORED;
392 384 }
393 385  
... ... @@ -604,7 +596,7 @@
604 596 char *msg;
605 597 int (*action)(struct page *p, unsigned long pfn);
606 598 } error_states[] = {
607   - { reserved, reserved, "reserved kernel", me_ignore },
  599 + { reserved, reserved, "reserved kernel", me_kernel },
608 600 /*
609 601 * free pages are specially detected outside this table:
610 602 * PG_buddy pages only make a small fraction of all free pages.
... ... @@ -788,7 +780,7 @@
788 780  
789 781 p = pfn_to_page(pfn);
790 782 if (TestSetPageHWPoison(p)) {
791   - action_result(pfn, "already hardware poisoned", IGNORED);
  783 + printk(KERN_ERR "MCE %#lx: already hardware poisoned\n", pfn);
792 784 return 0;
793 785 }
794 786  
... ... @@ -843,7 +835,7 @@
843 835 * unpoison always clear PG_hwpoison inside page lock
844 836 */
845 837 if (!PageHWPoison(p)) {
846   - action_result(pfn, "unpoisoned", IGNORED);
  838 + printk(KERN_ERR "MCE %#lx: just unpoisoned\n", pfn);
847 839 res = 0;
848 840 goto out;
849 841 }
... ... @@ -865,7 +857,7 @@
865 857 */
866 858 if (PageLRU(p) && !PageSwapCache(p) && p->mapping == NULL) {
867 859 action_result(pfn, "already truncated LRU", IGNORED);
868   - res = 0;
  860 + res = -EBUSY;
869 861 goto out;
870 862 }
871 863