Commit d95ea51e authored by Wu Fengguang's avatar Wu Fengguang Committed by Andi Kleen

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: default avatarWu Fengguang <fengguang.wu@intel.com>
Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
parent 847ce401
...@@ -336,16 +336,16 @@ static void collect_procs(struct page *page, struct list_head *tokill) ...@@ -336,16 +336,16 @@ static void collect_procs(struct page *page, struct list_head *tokill)
*/ */
enum outcome { enum outcome {
FAILED, /* Error handling failed */ IGNORED, /* Error: cannot be handled */
FAILED, /* Error: handling failed */
DELAYED, /* Will be handled later */ DELAYED, /* Will be handled later */
IGNORED, /* Error safely ignored */
RECOVERED, /* Successfully recovered */ RECOVERED, /* Successfully recovered */
}; };
static const char *action_name[] = { static const char *action_name[] = {
[IGNORED] = "Ignored",
[FAILED] = "Failed", [FAILED] = "Failed",
[DELAYED] = "Delayed", [DELAYED] = "Delayed",
[IGNORED] = "Ignored",
[RECOVERED] = "Recovered", [RECOVERED] = "Recovered",
}; };
...@@ -379,14 +379,6 @@ static int delete_from_lru_cache(struct page *p) ...@@ -379,14 +379,6 @@ static int delete_from_lru_cache(struct page *p)
* could be more sophisticated. * could be more sophisticated.
*/ */
static int me_kernel(struct page *p, unsigned long pfn) static int me_kernel(struct page *p, unsigned long pfn)
{
return DELAYED;
}
/*
* Already poisoned page.
*/
static int me_ignore(struct page *p, unsigned long pfn)
{ {
return IGNORED; return IGNORED;
} }
...@@ -604,7 +596,7 @@ static struct page_state { ...@@ -604,7 +596,7 @@ static struct page_state {
char *msg; char *msg;
int (*action)(struct page *p, unsigned long pfn); int (*action)(struct page *p, unsigned long pfn);
} error_states[] = { } error_states[] = {
{ reserved, reserved, "reserved kernel", me_ignore }, { reserved, reserved, "reserved kernel", me_kernel },
/* /*
* free pages are specially detected outside this table: * free pages are specially detected outside this table:
* PG_buddy pages only make a small fraction of all free pages. * 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,7 +780,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
p = pfn_to_page(pfn); p = pfn_to_page(pfn);
if (TestSetPageHWPoison(p)) { if (TestSetPageHWPoison(p)) {
action_result(pfn, "already hardware poisoned", IGNORED); printk(KERN_ERR "MCE %#lx: already hardware poisoned\n", pfn);
return 0; return 0;
} }
...@@ -843,7 +835,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags) ...@@ -843,7 +835,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
* unpoison always clear PG_hwpoison inside page lock * unpoison always clear PG_hwpoison inside page lock
*/ */
if (!PageHWPoison(p)) { if (!PageHWPoison(p)) {
action_result(pfn, "unpoisoned", IGNORED); printk(KERN_ERR "MCE %#lx: just unpoisoned\n", pfn);
res = 0; res = 0;
goto out; goto out;
} }
...@@ -865,7 +857,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags) ...@@ -865,7 +857,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
*/ */
if (PageLRU(p) && !PageSwapCache(p) && p->mapping == NULL) { if (PageLRU(p) && !PageSwapCache(p) && p->mapping == NULL) {
action_result(pfn, "already truncated LRU", IGNORED); action_result(pfn, "already truncated LRU", IGNORED);
res = 0; res = -EBUSY;
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment