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 /include | |
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 'include')
-rw-r--r-- | include/asm-generic/mman-common.h | 1 | ||||
-rw-r--r-- | include/linux/kernel-page-flags.h | 46 | ||||
-rw-r--r-- | include/linux/memcontrol.h | 13 | ||||
-rw-r--r-- | include/linux/mm.h | 8 | ||||
-rw-r--r-- | include/linux/page-flags.h | 4 |
5 files changed, 70 insertions, 2 deletions
diff --git a/include/asm-generic/mman-common.h b/include/asm-generic/mman-common.h index 20111265afd8..3da9e2742fa0 100644 --- a/include/asm-generic/mman-common.h +++ b/include/asm-generic/mman-common.h | |||
@@ -40,6 +40,7 @@ | |||
40 | #define MADV_DONTFORK 10 /* don't inherit across fork */ | 40 | #define MADV_DONTFORK 10 /* don't inherit across fork */ |
41 | #define MADV_DOFORK 11 /* do inherit across fork */ | 41 | #define MADV_DOFORK 11 /* do inherit across fork */ |
42 | #define MADV_HWPOISON 100 /* poison a page for testing */ | 42 | #define MADV_HWPOISON 100 /* poison a page for testing */ |
43 | #define MADV_SOFT_OFFLINE 101 /* soft offline page for testing */ | ||
43 | 44 | ||
44 | #define MADV_MERGEABLE 12 /* KSM may merge identical pages */ | 45 | #define MADV_MERGEABLE 12 /* KSM may merge identical pages */ |
45 | #define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ | 46 | #define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ |
diff --git a/include/linux/kernel-page-flags.h b/include/linux/kernel-page-flags.h new file mode 100644 index 000000000000..bd92a89f4b0a --- /dev/null +++ b/include/linux/kernel-page-flags.h | |||
@@ -0,0 +1,46 @@ | |||
1 | #ifndef LINUX_KERNEL_PAGE_FLAGS_H | ||
2 | #define LINUX_KERNEL_PAGE_FLAGS_H | ||
3 | |||
4 | /* | ||
5 | * Stable page flag bits exported to user space | ||
6 | */ | ||
7 | |||
8 | #define KPF_LOCKED 0 | ||
9 | #define KPF_ERROR 1 | ||
10 | #define KPF_REFERENCED 2 | ||
11 | #define KPF_UPTODATE 3 | ||
12 | #define KPF_DIRTY 4 | ||
13 | #define KPF_LRU 5 | ||
14 | #define KPF_ACTIVE 6 | ||
15 | #define KPF_SLAB 7 | ||
16 | #define KPF_WRITEBACK 8 | ||
17 | #define KPF_RECLAIM 9 | ||
18 | #define KPF_BUDDY 10 | ||
19 | |||
20 | /* 11-20: new additions in 2.6.31 */ | ||
21 | #define KPF_MMAP 11 | ||
22 | #define KPF_ANON 12 | ||
23 | #define KPF_SWAPCACHE 13 | ||
24 | #define KPF_SWAPBACKED 14 | ||
25 | #define KPF_COMPOUND_HEAD 15 | ||
26 | #define KPF_COMPOUND_TAIL 16 | ||
27 | #define KPF_HUGE 17 | ||
28 | #define KPF_UNEVICTABLE 18 | ||
29 | #define KPF_HWPOISON 19 | ||
30 | #define KPF_NOPAGE 20 | ||
31 | |||
32 | #define KPF_KSM 21 | ||
33 | |||
34 | /* kernel hacking assistances | ||
35 | * WARNING: subject to change, never rely on them! | ||
36 | */ | ||
37 | #define KPF_RESERVED 32 | ||
38 | #define KPF_MLOCKED 33 | ||
39 | #define KPF_MAPPEDTODISK 34 | ||
40 | #define KPF_PRIVATE 35 | ||
41 | #define KPF_PRIVATE_2 36 | ||
42 | #define KPF_OWNER_PRIVATE 37 | ||
43 | #define KPF_ARCH 38 | ||
44 | #define KPF_UNCACHED 39 | ||
45 | |||
46 | #endif /* LINUX_KERNEL_PAGE_FLAGS_H */ | ||
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 0b46c2068b96..1f9b119f4ace 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -73,6 +73,7 @@ extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | |||
73 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); | 73 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); |
74 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | 74 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); |
75 | 75 | ||
76 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); | ||
76 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); | 77 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); |
77 | 78 | ||
78 | static inline | 79 | static inline |
@@ -85,6 +86,8 @@ int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) | |||
85 | return cgroup == mem; | 86 | return cgroup == mem; |
86 | } | 87 | } |
87 | 88 | ||
89 | extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem); | ||
90 | |||
88 | extern int | 91 | extern int |
89 | mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr); | 92 | mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr); |
90 | extern void mem_cgroup_end_migration(struct mem_cgroup *mem, | 93 | extern void mem_cgroup_end_migration(struct mem_cgroup *mem, |
@@ -202,6 +205,11 @@ mem_cgroup_move_lists(struct page *page, enum lru_list from, enum lru_list to) | |||
202 | { | 205 | { |
203 | } | 206 | } |
204 | 207 | ||
208 | static inline struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page) | ||
209 | { | ||
210 | return NULL; | ||
211 | } | ||
212 | |||
205 | static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) | 213 | static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) |
206 | { | 214 | { |
207 | return 1; | 215 | return 1; |
@@ -213,6 +221,11 @@ static inline int task_in_mem_cgroup(struct task_struct *task, | |||
213 | return 1; | 221 | return 1; |
214 | } | 222 | } |
215 | 223 | ||
224 | static inline struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem) | ||
225 | { | ||
226 | return NULL; | ||
227 | } | ||
228 | |||
216 | static inline int | 229 | static inline int |
217 | mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr) | 230 | mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr) |
218 | { | 231 | { |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 9d65ae4ba0e0..849b4a61bd8f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1331,11 +1331,17 @@ extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim, | |||
1331 | size_t size); | 1331 | size_t size); |
1332 | extern void refund_locked_memory(struct mm_struct *mm, size_t size); | 1332 | extern void refund_locked_memory(struct mm_struct *mm, size_t size); |
1333 | 1333 | ||
1334 | enum mf_flags { | ||
1335 | MF_COUNT_INCREASED = 1 << 0, | ||
1336 | }; | ||
1334 | extern void memory_failure(unsigned long pfn, int trapno); | 1337 | extern void memory_failure(unsigned long pfn, int trapno); |
1335 | extern int __memory_failure(unsigned long pfn, int trapno, int ref); | 1338 | extern int __memory_failure(unsigned long pfn, int trapno, int flags); |
1339 | extern int unpoison_memory(unsigned long pfn); | ||
1336 | extern int sysctl_memory_failure_early_kill; | 1340 | extern int sysctl_memory_failure_early_kill; |
1337 | extern int sysctl_memory_failure_recovery; | 1341 | extern int sysctl_memory_failure_recovery; |
1342 | extern void shake_page(struct page *p, int access); | ||
1338 | extern atomic_long_t mce_bad_pages; | 1343 | extern atomic_long_t mce_bad_pages; |
1344 | extern int soft_offline_page(struct page *page, int flags); | ||
1339 | 1345 | ||
1340 | #endif /* __KERNEL__ */ | 1346 | #endif /* __KERNEL__ */ |
1341 | #endif /* _LINUX_MM_H */ | 1347 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 49e907bd067f..feee2ba8d06a 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -275,13 +275,15 @@ PAGEFLAG_FALSE(Uncached) | |||
275 | 275 | ||
276 | #ifdef CONFIG_MEMORY_FAILURE | 276 | #ifdef CONFIG_MEMORY_FAILURE |
277 | PAGEFLAG(HWPoison, hwpoison) | 277 | PAGEFLAG(HWPoison, hwpoison) |
278 | TESTSETFLAG(HWPoison, hwpoison) | 278 | TESTSCFLAG(HWPoison, hwpoison) |
279 | #define __PG_HWPOISON (1UL << PG_hwpoison) | 279 | #define __PG_HWPOISON (1UL << PG_hwpoison) |
280 | #else | 280 | #else |
281 | PAGEFLAG_FALSE(HWPoison) | 281 | PAGEFLAG_FALSE(HWPoison) |
282 | #define __PG_HWPOISON 0 | 282 | #define __PG_HWPOISON 0 |
283 | #endif | 283 | #endif |
284 | 284 | ||
285 | u64 stable_page_flags(struct page *page); | ||
286 | |||
285 | static inline int PageUptodate(struct page *page) | 287 | static inline int PageUptodate(struct page *page) |
286 | { | 288 | { |
287 | int ret = test_bit(PG_uptodate, &(page)->flags); | 289 | int ret = test_bit(PG_uptodate, &(page)->flags); |