summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWu Fengguang <fengguang.wu@intel.com>2009-12-16 12:19:58 +0100
committerAndi Kleen <ak@linux.intel.com>2009-12-16 12:19:58 +0100
commitd95ea51e3a7e9ee051d19f1dd283ca61d1aa5ec6 (patch)
treec7bbafb931c9023dfaf1db8e4882a7154dc88ba0
parent847ce401df392b0704369fd3f75df614ac1414b4 (diff)
downloadop-kernel-dev-d95ea51e3a7e9ee051d19f1dd283ca61d1aa5ec6.zip
op-kernel-dev-d95ea51e3a7e9ee051d19f1dd283ca61d1aa5ec6.tar.gz
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>
-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 ed6e91c..fd1ac15 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)
*/
enum outcome {
- FAILED, /* Error handling failed */
+ IGNORED, /* Error: cannot be handled */
+ FAILED, /* Error: handling failed */
DELAYED, /* Will be handled later */
- IGNORED, /* Error safely ignored */
RECOVERED, /* Successfully recovered */
};
static const char *action_name[] = {
+ [IGNORED] = "Ignored",
[FAILED] = "Failed",
[DELAYED] = "Delayed",
- [IGNORED] = "Ignored",
[RECOVERED] = "Recovered",
};
@@ -380,14 +380,6 @@ static int delete_from_lru_cache(struct page *p)
*/
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;
}
@@ -604,7 +596,7 @@ static struct page_state {
char *msg;
int (*action)(struct page *p, unsigned long pfn);
} error_states[] = {
- { reserved, reserved, "reserved kernel", me_ignore },
+ { reserved, reserved, "reserved kernel", me_kernel },
/*
* free pages are specially detected outside this table:
* 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)
p = pfn_to_page(pfn);
if (TestSetPageHWPoison(p)) {
- action_result(pfn, "already hardware poisoned", IGNORED);
+ printk(KERN_ERR "MCE %#lx: already hardware poisoned\n", pfn);
return 0;
}
@@ -843,7 +835,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
* unpoison always clear PG_hwpoison inside page lock
*/
if (!PageHWPoison(p)) {
- action_result(pfn, "unpoisoned", IGNORED);
+ printk(KERN_ERR "MCE %#lx: just unpoisoned\n", pfn);
res = 0;
goto out;
}
@@ -865,7 +857,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
*/
if (PageLRU(p) && !PageSwapCache(p) && p->mapping == NULL) {
action_result(pfn, "already truncated LRU", IGNORED);
- res = 0;
+ res = -EBUSY;
goto out;
}
OpenPOWER on IntegriCloud