diff options
Diffstat (limited to 'Documentation/vm/hwpoison.txt')
-rw-r--r-- | Documentation/vm/hwpoison.txt | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/Documentation/vm/hwpoison.txt b/Documentation/vm/hwpoison.txt index 3ffadf8da61f..12f9ba20ccb7 100644 --- a/Documentation/vm/hwpoison.txt +++ b/Documentation/vm/hwpoison.txt | |||
@@ -92,16 +92,62 @@ PR_MCE_KILL_GET | |||
92 | 92 | ||
93 | Testing: | 93 | Testing: |
94 | 94 | ||
95 | madvise(MADV_POISON, ....) | 95 | madvise(MADV_HWPOISON, ....) |
96 | (as root) | 96 | (as root) |
97 | Poison a page in the process for testing | 97 | Poison a page in the process for testing |
98 | 98 | ||
99 | 99 | ||
100 | hwpoison-inject module through debugfs | 100 | hwpoison-inject module through debugfs |
101 | /sys/debug/hwpoison/corrupt-pfn | ||
102 | 101 | ||
103 | Inject hwpoison fault at PFN echoed into this file | 102 | /sys/debug/hwpoison/ |
104 | 103 | ||
104 | corrupt-pfn | ||
105 | |||
106 | Inject hwpoison fault at PFN echoed into this file. This does | ||
107 | some early filtering to avoid corrupted unintended pages in test suites. | ||
108 | |||
109 | unpoison-pfn | ||
110 | |||
111 | Software-unpoison page at PFN echoed into this file. This | ||
112 | way a page can be reused again. | ||
113 | This only works for Linux injected failures, not for real | ||
114 | memory failures. | ||
115 | |||
116 | Note these injection interfaces are not stable and might change between | ||
117 | kernel versions | ||
118 | |||
119 | corrupt-filter-dev-major | ||
120 | corrupt-filter-dev-minor | ||
121 | |||
122 | Only handle memory failures to pages associated with the file system defined | ||
123 | by block device major/minor. -1U is the wildcard value. | ||
124 | This should be only used for testing with artificial injection. | ||
125 | |||
126 | corrupt-filter-memcg | ||
127 | |||
128 | Limit injection to pages owned by memgroup. Specified by inode number | ||
129 | of the memcg. | ||
130 | |||
131 | Example: | ||
132 | mkdir /cgroup/hwpoison | ||
133 | |||
134 | usemem -m 100 -s 1000 & | ||
135 | echo `jobs -p` > /cgroup/hwpoison/tasks | ||
136 | |||
137 | memcg_ino=$(ls -id /cgroup/hwpoison | cut -f1 -d' ') | ||
138 | echo $memcg_ino > /debug/hwpoison/corrupt-filter-memcg | ||
139 | |||
140 | page-types -p `pidof init` --hwpoison # shall do nothing | ||
141 | page-types -p `pidof usemem` --hwpoison # poison its pages | ||
142 | |||
143 | corrupt-filter-flags-mask | ||
144 | corrupt-filter-flags-value | ||
145 | |||
146 | When specified, only poison pages if ((page_flags & mask) == value). | ||
147 | This allows stress testing of many kinds of pages. The page_flags | ||
148 | are the same as in /proc/kpageflags. The flag bits are defined in | ||
149 | include/linux/kernel-page-flags.h and documented in | ||
150 | Documentation/vm/pagemap.txt | ||
105 | 151 | ||
106 | Architecture specific MCE injector | 152 | Architecture specific MCE injector |
107 | 153 | ||