diff options
| author | Prasad Sodagudi <psodagud@codeaurora.org> | 2016-02-25 13:01:18 +0530 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-25 16:03:55 -0700 |
| commit | d099e491b8b8e2f6370d5359ff38b1f4bb276f30 (patch) | |
| tree | 9314f1a7277032fb95ea94c388192b92b0908210 /mm/debug-pagealloc.c | |
| parent | 11c42c9d0874b55d1a09424f43180db8ae539618 (diff) | |
debug-pagealloc: print physical address for detected corruption
It's sometimes useful to know the physical address which
has beencorrupted, especially in systems with multiple
bus masters and DMA engines the capability of writing
to memory. It's may also be useful for identifying the
location of failures of memory cells in cases of
device-specific corruption. So print the physical
start address of the page to help in these scenarios.
Change-Id: I081edd8b1c06913c0057a6cb9dda18077cfbdc30
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Diffstat (limited to 'mm/debug-pagealloc.c')
| -rw-r--r-- | mm/debug-pagealloc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mm/debug-pagealloc.c b/mm/debug-pagealloc.c index de50b1b9a791..100963091cc6 100644 --- a/mm/debug-pagealloc.c +++ b/mm/debug-pagealloc.c @@ -86,7 +86,8 @@ static bool single_bit_flip(unsigned char a, unsigned char b) return error && !(error & (error - 1)); } -static void check_poison_mem(unsigned char *mem, size_t bytes) +static void check_poison_mem(struct page *page, + unsigned char *mem, size_t bytes) { static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 10); unsigned char *start; @@ -104,9 +105,11 @@ static void check_poison_mem(unsigned char *mem, size_t bytes) if (!__ratelimit(&ratelimit)) return; else if (start == end && single_bit_flip(*start, PAGE_POISON)) - printk(KERN_ERR "pagealloc: single bit error\n"); + pr_err("pagealloc: single bit error on page with phys start 0x%lx\n", + (unsigned long)page_to_phys(page)); else - printk(KERN_ERR "pagealloc: memory corruption\n"); + pr_err("pagealloc: memory corruption on page with phys start 0x%lx\n", + (unsigned long)page_to_phys(page)); print_hex_dump(KERN_ERR, "", DUMP_PREFIX_ADDRESS, 16, 1, start, end - start + 1, 1); @@ -122,7 +125,7 @@ static void unpoison_page(struct page *page) return; addr = kmap_atomic(page); - check_poison_mem(addr, PAGE_SIZE); + check_poison_mem(page, addr, PAGE_SIZE); mark_addr_rdwrite(addr); clear_page_poison(page); kunmap_atomic(addr); |
