diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2009-12-16 06:19:59 -0500 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2009-12-16 06:19:59 -0500 |
commit | 478c5ffc0b50527bd2390f2daa46cc16276b8413 (patch) | |
tree | f58f5be9760fd0e81567611cf6e9f9bc77d1d3cd /mm/hwpoison-inject.c | |
parent | 1a9b5b7fe0c5dad8a635288882d36785dea742f9 (diff) |
HWPOISON: add page flags filter
When specified, only poison pages if ((page_flags & mask) == value).
- corrupt-filter-flags-mask
- corrupt-filter-flags-value
This allows stress testing of many kinds of pages.
Strictly speaking, the buddy pages requires taking zone lock, to avoid
setting PG_hwpoison on a "was buddy but now allocated to someone" page.
However we can just do nothing because we set PG_locked in the beginning,
this prevents the page allocator from allocating it to someone. (It will
BUG() on the unexpected PG_locked, which is fine for hwpoison testing.)
[AK: Add select PROC_PAGE_MONITOR to satisfy dependency]
CC: Nick Piggin <npiggin@suse.de>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'mm/hwpoison-inject.c')
-rw-r--r-- | mm/hwpoison-inject.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mm/hwpoison-inject.c b/mm/hwpoison-inject.c index 2b6b3200fa65..c4dfd89f654a 100644 --- a/mm/hwpoison-inject.c +++ b/mm/hwpoison-inject.c | |||
@@ -102,6 +102,16 @@ static int pfn_inject_init(void) | |||
102 | if (!dentry) | 102 | if (!dentry) |
103 | goto fail; | 103 | goto fail; |
104 | 104 | ||
105 | dentry = debugfs_create_u64("corrupt-filter-flags-mask", 0600, | ||
106 | hwpoison_dir, &hwpoison_filter_flags_mask); | ||
107 | if (!dentry) | ||
108 | goto fail; | ||
109 | |||
110 | dentry = debugfs_create_u64("corrupt-filter-flags-value", 0600, | ||
111 | hwpoison_dir, &hwpoison_filter_flags_value); | ||
112 | if (!dentry) | ||
113 | goto fail; | ||
114 | |||
105 | return 0; | 115 | return 0; |
106 | fail: | 116 | fail: |
107 | pfn_inject_exit(); | 117 | pfn_inject_exit(); |