diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 15:36:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 15:36:49 -0500 |
commit | d4220f987cf473c65a342ca69e3eb13dea919a49 (patch) | |
tree | dbb004a9c805d6de3f6e3955398fee1084a29f16 /Documentation | |
parent | 61cf693159d6a968a7014e24905143f71ed8ddcf (diff) | |
parent | f2c03debdfb387fa2e35cac6382779072b8b9209 (diff) |
Merge branch 'hwpoison' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6
* 'hwpoison' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6: (34 commits)
HWPOISON: Remove stray phrase in a comment
HWPOISON: Try to allocate migration page on the same node
HWPOISON: Don't do early filtering if filter is disabled
HWPOISON: Add a madvise() injector for soft page offlining
HWPOISON: Add soft page offline support
HWPOISON: Undefine short-hand macros after use to avoid namespace conflict
HWPOISON: Use new shake_page in memory_failure
HWPOISON: Use correct name for MADV_HWPOISON in documentation
HWPOISON: mention HWPoison in Kconfig entry
HWPOISON: Use get_user_page_fast in hwpoison madvise
HWPOISON: add an interface to switch off/on all the page filters
HWPOISON: add memory cgroup filter
memcg: add accessor to mem_cgroup.css
memcg: rename and export try_get_mem_cgroup_from_page()
HWPOISON: add page flags filter
mm: export stable page flags
HWPOISON: limit hwpoison injector to known page types
HWPOISON: add fs/device filters
HWPOISON: return 0 to indicate success reliably
HWPOISON: make semantics of IGNORED/DELAYED clear
...
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/ABI/testing/sysfs-memory-page-offline | 44 | ||||
-rw-r--r-- | Documentation/vm/hwpoison.txt | 52 | ||||
-rw-r--r-- | Documentation/vm/page-types.c | 15 |
3 files changed, 106 insertions, 5 deletions
diff --git a/Documentation/ABI/testing/sysfs-memory-page-offline b/Documentation/ABI/testing/sysfs-memory-page-offline new file mode 100644 index 000000000000..e14703f12fdf --- /dev/null +++ b/Documentation/ABI/testing/sysfs-memory-page-offline | |||
@@ -0,0 +1,44 @@ | |||
1 | What: /sys/devices/system/memory/soft_offline_page | ||
2 | Date: Sep 2009 | ||
3 | KernelVersion: 2.6.33 | ||
4 | Contact: andi@firstfloor.org | ||
5 | Description: | ||
6 | Soft-offline the memory page containing the physical address | ||
7 | written into this file. Input is a hex number specifying the | ||
8 | physical address of the page. The kernel will then attempt | ||
9 | to soft-offline it, by moving the contents elsewhere or | ||
10 | dropping it if possible. The kernel will then be placed | ||
11 | on the bad page list and never be reused. | ||
12 | |||
13 | The offlining is done in kernel specific granuality. | ||
14 | Normally it's the base page size of the kernel, but | ||
15 | this might change. | ||
16 | |||
17 | The page must be still accessible, not poisoned. The | ||
18 | kernel will never kill anything for this, but rather | ||
19 | fail the offline. Return value is the size of the | ||
20 | number, or a error when the offlining failed. Reading | ||
21 | the file is not allowed. | ||
22 | |||
23 | What: /sys/devices/system/memory/hard_offline_page | ||
24 | Date: Sep 2009 | ||
25 | KernelVersion: 2.6.33 | ||
26 | Contact: andi@firstfloor.org | ||
27 | Description: | ||
28 | Hard-offline the memory page containing the physical | ||
29 | address written into this file. Input is a hex number | ||
30 | specifying the physical address of the page. The | ||
31 | kernel will then attempt to hard-offline the page, by | ||
32 | trying to drop the page or killing any owner or | ||
33 | triggering IO errors if needed. Note this may kill | ||
34 | any processes owning the page. The kernel will avoid | ||
35 | to access this page assuming it's poisoned by the | ||
36 | hardware. | ||
37 | |||
38 | The offlining is done in kernel specific granuality. | ||
39 | Normally it's the base page size of the kernel, but | ||
40 | this might change. | ||
41 | |||
42 | Return value is the size of the number, or a error when | ||
43 | the offlining failed. | ||
44 | Reading the file is not allowed. | ||
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 | ||
diff --git a/Documentation/vm/page-types.c b/Documentation/vm/page-types.c index 7a7d9bab32ef..66e9358e2144 100644 --- a/Documentation/vm/page-types.c +++ b/Documentation/vm/page-types.c | |||
@@ -1,11 +1,22 @@ | |||
1 | /* | 1 | /* |
2 | * page-types: Tool for querying page flags | 2 | * page-types: Tool for querying page flags |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License as published by the Free | ||
6 | * Software Foundation; version 2. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should find a copy of v2 of the GNU General Public License somewhere on | ||
14 | * your Linux system; if not, write to the Free Software Foundation, Inc., 59 | ||
15 | * Temple Place, Suite 330, Boston, MA 02111-1307 USA. | ||
16 | * | ||
4 | * Copyright (C) 2009 Intel corporation | 17 | * Copyright (C) 2009 Intel corporation |
5 | * | 18 | * |
6 | * Authors: Wu Fengguang <fengguang.wu@intel.com> | 19 | * Authors: Wu Fengguang <fengguang.wu@intel.com> |
7 | * | ||
8 | * Released under the General Public License (GPL). | ||
9 | */ | 20 | */ |
10 | 21 | ||
11 | #define _LARGEFILE64_SOURCE | 22 | #define _LARGEFILE64_SOURCE |