diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-13 16:00:36 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-13 16:00:36 -0500 |
commit | 78a45c6f067824cf5d0a9fedea7339ac2e28603c (patch) | |
tree | b4f78c8b6b9059ddace0a18c11629b8d2045f793 /include/linux/page_ext.h | |
parent | f96fe225677b3efb74346ebd56fafe3997b02afa (diff) | |
parent | 29d293b6007b91a4463f05bc8d0b26e0e65c5816 (diff) |
Merge branch 'akpm' (second patch-bomb from Andrew)
Merge second patchbomb from Andrew Morton:
- the rest of MM
- misc fs fixes
- add execveat() syscall
- new ratelimit feature for fault-injection
- decompressor updates
- ipc/ updates
- fallocate feature creep
- fsnotify cleanups
- a few other misc things
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (99 commits)
cgroups: Documentation: fix trivial typos and wrong paragraph numberings
parisc: percpu: update comments referring to __get_cpu_var
percpu: update local_ops.txt to reflect this_cpu operations
percpu: remove __get_cpu_var and __raw_get_cpu_var macros
fsnotify: remove destroy_list from fsnotify_mark
fsnotify: unify inode and mount marks handling
fallocate: create FAN_MODIFY and IN_MODIFY events
mm/cma: make kmemleak ignore CMA regions
slub: fix cpuset check in get_any_partial
slab: fix cpuset check in fallback_alloc
shmdt: use i_size_read() instead of ->i_size
ipc/shm.c: fix overly aggressive shmdt() when calls span multiple segments
ipc/msg: increase MSGMNI, remove scaling
ipc/sem.c: increase SEMMSL, SEMMNI, SEMOPM
ipc/sem.c: change memory barrier in sem_lock() to smp_rmb()
lib/decompress.c: consistency of compress formats for kernel image
decompress_bunzip2: off by one in get_next_block()
usr/Kconfig: make initrd compression algorithm selection not expert
fault-inject: add ratelimit option
ratelimit: add initialization macro
...
Diffstat (limited to 'include/linux/page_ext.h')
-rw-r--r-- | include/linux/page_ext.h | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/include/linux/page_ext.h b/include/linux/page_ext.h new file mode 100644 index 000000000000..d2a2c84c72d0 --- /dev/null +++ b/include/linux/page_ext.h | |||
@@ -0,0 +1,84 @@ | |||
1 | #ifndef __LINUX_PAGE_EXT_H | ||
2 | #define __LINUX_PAGE_EXT_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/stacktrace.h> | ||
6 | |||
7 | struct pglist_data; | ||
8 | struct page_ext_operations { | ||
9 | bool (*need)(void); | ||
10 | void (*init)(void); | ||
11 | }; | ||
12 | |||
13 | #ifdef CONFIG_PAGE_EXTENSION | ||
14 | |||
15 | /* | ||
16 | * page_ext->flags bits: | ||
17 | * | ||
18 | * PAGE_EXT_DEBUG_POISON is set for poisoned pages. This is used to | ||
19 | * implement generic debug pagealloc feature. The pages are filled with | ||
20 | * poison patterns and set this flag after free_pages(). The poisoned | ||
21 | * pages are verified whether the patterns are not corrupted and clear | ||
22 | * the flag before alloc_pages(). | ||
23 | */ | ||
24 | |||
25 | enum page_ext_flags { | ||
26 | PAGE_EXT_DEBUG_POISON, /* Page is poisoned */ | ||
27 | PAGE_EXT_DEBUG_GUARD, | ||
28 | PAGE_EXT_OWNER, | ||
29 | }; | ||
30 | |||
31 | /* | ||
32 | * Page Extension can be considered as an extended mem_map. | ||
33 | * A page_ext page is associated with every page descriptor. The | ||
34 | * page_ext helps us add more information about the page. | ||
35 | * All page_ext are allocated at boot or memory hotplug event, | ||
36 | * then the page_ext for pfn always exists. | ||
37 | */ | ||
38 | struct page_ext { | ||
39 | unsigned long flags; | ||
40 | #ifdef CONFIG_PAGE_OWNER | ||
41 | unsigned int order; | ||
42 | gfp_t gfp_mask; | ||
43 | struct stack_trace trace; | ||
44 | unsigned long trace_entries[8]; | ||
45 | #endif | ||
46 | }; | ||
47 | |||
48 | extern void pgdat_page_ext_init(struct pglist_data *pgdat); | ||
49 | |||
50 | #ifdef CONFIG_SPARSEMEM | ||
51 | static inline void page_ext_init_flatmem(void) | ||
52 | { | ||
53 | } | ||
54 | extern void page_ext_init(void); | ||
55 | #else | ||
56 | extern void page_ext_init_flatmem(void); | ||
57 | static inline void page_ext_init(void) | ||
58 | { | ||
59 | } | ||
60 | #endif | ||
61 | |||
62 | struct page_ext *lookup_page_ext(struct page *page); | ||
63 | |||
64 | #else /* !CONFIG_PAGE_EXTENSION */ | ||
65 | struct page_ext; | ||
66 | |||
67 | static inline void pgdat_page_ext_init(struct pglist_data *pgdat) | ||
68 | { | ||
69 | } | ||
70 | |||
71 | static inline struct page_ext *lookup_page_ext(struct page *page) | ||
72 | { | ||
73 | return NULL; | ||
74 | } | ||
75 | |||
76 | static inline void page_ext_init(void) | ||
77 | { | ||
78 | } | ||
79 | |||
80 | static inline void page_ext_init_flatmem(void) | ||
81 | { | ||
82 | } | ||
83 | #endif /* CONFIG_PAGE_EXTENSION */ | ||
84 | #endif /* __LINUX_PAGE_EXT_H */ | ||