[PATCH 1/8] pagemap: export KPF_HWPOISON

From: Wu Fengguang
Date: Wed Sep 16 2009 - 06:29:19 EST


This flag indicates a hardware detected memory corruption on the page.
Any future access of the page data may bring down the machine.

CC: Andi Kleen <andi@xxxxxxxxxxxxxx>
Signed-off-by: Wu Fengguang <fengguang.wu@xxxxxxxxx>
---
Documentation/vm/page-types.c | 2 ++
Documentation/vm/pagemap.txt | 4 ++++
fs/proc/page.c | 5 +++++
3 files changed, 11 insertions(+)

--- linux-mm.orig/fs/proc/page.c 2009-09-15 17:37:38.000000000 +0800
+++ linux-mm/fs/proc/page.c 2009-09-16 17:12:50.000000000 +0800
@@ -94,6 +94,7 @@ static const struct file_operations proc
#define KPF_COMPOUND_TAIL 16
#define KPF_HUGE 17
#define KPF_UNEVICTABLE 18
+#define KPF_HWPOISON 19
#define KPF_NOPAGE 20

#define KPF_KSM 21
@@ -180,6 +181,10 @@ u64 page_uflags(struct page *page)
u |= kpf_copy_bit(k, KPF_UNEVICTABLE, PG_unevictable);
u |= kpf_copy_bit(k, KPF_MLOCKED, PG_mlocked);

+#ifdef CONFIG_MEMORY_FAILURE
+ u |= kpf_copy_bit(k, KPF_HWPOISON, PG_hwpoison);
+#endif
+
#ifdef CONFIG_IA64_UNCACHED_ALLOCATOR
u |= kpf_copy_bit(k, KPF_UNCACHED, PG_uncached);
#endif
--- linux-mm.orig/Documentation/vm/page-types.c 2009-09-16 17:12:01.000000000 +0800
+++ linux-mm/Documentation/vm/page-types.c 2009-09-16 17:12:50.000000000 +0800
@@ -69,6 +69,7 @@
#define KPF_COMPOUND_TAIL 16
#define KPF_HUGE 17
#define KPF_UNEVICTABLE 18
+#define KPF_HWPOISON 19
#define KPF_NOPAGE 20

/* [32-] kernel hacking assistances */
@@ -116,6 +117,7 @@ static char *page_flag_names[] = {
[KPF_COMPOUND_TAIL] = "T:compound_tail",
[KPF_HUGE] = "G:huge",
[KPF_UNEVICTABLE] = "u:unevictable",
+ [KPF_HWPOISON] = "X:hwpoison",
[KPF_NOPAGE] = "n:nopage",

[KPF_RESERVED] = "r:reserved",
--- linux-mm.orig/Documentation/vm/pagemap.txt 2009-09-11 18:43:25.000000000 +0800
+++ linux-mm/Documentation/vm/pagemap.txt 2009-09-16 17:12:50.000000000 +0800
@@ -57,6 +57,7 @@ There are three components to pagemap:
16. COMPOUND_TAIL
16. HUGE
18. UNEVICTABLE
+ 19. HWPOISON
20. NOPAGE

Short descriptions to the page flags:
@@ -86,6 +87,9 @@ Short descriptions to the page flags:
17. HUGE
this is an integral part of a HugeTLB page

+19. HWPOISON
+ hardware detected memory corruption on this page: don't touch the data!
+
20. NOPAGE
no page frame exists at the requested address


--

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/