diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/gfp.h | 5 | ||||
-rw-r--r-- | include/linux/kmemcheck.h | 35 |
2 files changed, 34 insertions, 6 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index daeaa8fe1bbd..3885e7f75562 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -51,7 +51,12 @@ struct vm_area_struct; | |||
51 | #define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ | 51 | #define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ |
52 | #define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */ | 52 | #define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */ |
53 | #define __GFP_MOVABLE ((__force gfp_t)0x100000u) /* Page is movable */ | 53 | #define __GFP_MOVABLE ((__force gfp_t)0x100000u) /* Page is movable */ |
54 | |||
55 | #ifdef CONFIG_KMEMCHECK | ||
54 | #define __GFP_NOTRACK ((__force gfp_t)0x200000u) /* Don't track with kmemcheck */ | 56 | #define __GFP_NOTRACK ((__force gfp_t)0x200000u) /* Don't track with kmemcheck */ |
57 | #else | ||
58 | #define __GFP_NOTRACK ((__force gfp_t)0) | ||
59 | #endif | ||
55 | 60 | ||
56 | /* | 61 | /* |
57 | * This may seem redundant, but it's a way of annotating false positives vs. | 62 | * This may seem redundant, but it's a way of annotating false positives vs. |
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h index 71f21ae33d1d..093d23969b1b 100644 --- a/include/linux/kmemcheck.h +++ b/include/linux/kmemcheck.h | |||
@@ -8,13 +8,15 @@ | |||
8 | extern int kmemcheck_enabled; | 8 | extern int kmemcheck_enabled; |
9 | 9 | ||
10 | /* The slab-related functions. */ | 10 | /* The slab-related functions. */ |
11 | void kmemcheck_alloc_shadow(struct kmem_cache *s, gfp_t flags, int node, | 11 | void kmemcheck_alloc_shadow(struct page *page, int order, gfp_t flags, int node); |
12 | struct page *page, int order); | 12 | void kmemcheck_free_shadow(struct page *page, int order); |
13 | void kmemcheck_free_shadow(struct kmem_cache *s, struct page *page, int order); | ||
14 | void kmemcheck_slab_alloc(struct kmem_cache *s, gfp_t gfpflags, void *object, | 13 | void kmemcheck_slab_alloc(struct kmem_cache *s, gfp_t gfpflags, void *object, |
15 | size_t size); | 14 | size_t size); |
16 | void kmemcheck_slab_free(struct kmem_cache *s, void *object, size_t size); | 15 | void kmemcheck_slab_free(struct kmem_cache *s, void *object, size_t size); |
17 | 16 | ||
17 | void kmemcheck_pagealloc_alloc(struct page *p, unsigned int order, | ||
18 | gfp_t gfpflags); | ||
19 | |||
18 | void kmemcheck_show_pages(struct page *p, unsigned int n); | 20 | void kmemcheck_show_pages(struct page *p, unsigned int n); |
19 | void kmemcheck_hide_pages(struct page *p, unsigned int n); | 21 | void kmemcheck_hide_pages(struct page *p, unsigned int n); |
20 | 22 | ||
@@ -27,6 +29,7 @@ void kmemcheck_mark_freed(void *address, unsigned int n); | |||
27 | 29 | ||
28 | void kmemcheck_mark_unallocated_pages(struct page *p, unsigned int n); | 30 | void kmemcheck_mark_unallocated_pages(struct page *p, unsigned int n); |
29 | void kmemcheck_mark_uninitialized_pages(struct page *p, unsigned int n); | 31 | void kmemcheck_mark_uninitialized_pages(struct page *p, unsigned int n); |
32 | void kmemcheck_mark_initialized_pages(struct page *p, unsigned int n); | ||
30 | 33 | ||
31 | int kmemcheck_show_addr(unsigned long address); | 34 | int kmemcheck_show_addr(unsigned long address); |
32 | int kmemcheck_hide_addr(unsigned long address); | 35 | int kmemcheck_hide_addr(unsigned long address); |
@@ -34,13 +37,12 @@ int kmemcheck_hide_addr(unsigned long address); | |||
34 | #define kmemcheck_enabled 0 | 37 | #define kmemcheck_enabled 0 |
35 | 38 | ||
36 | static inline void | 39 | static inline void |
37 | kmemcheck_alloc_shadow(struct kmem_cache *s, gfp_t flags, int node, | 40 | kmemcheck_alloc_shadow(struct page *page, int order, gfp_t flags, int node) |
38 | struct page *page, int order) | ||
39 | { | 41 | { |
40 | } | 42 | } |
41 | 43 | ||
42 | static inline void | 44 | static inline void |
43 | kmemcheck_free_shadow(struct kmem_cache *s, struct page *page, int order) | 45 | kmemcheck_free_shadow(struct page *page, int order) |
44 | { | 46 | { |
45 | } | 47 | } |
46 | 48 | ||
@@ -55,6 +57,11 @@ static inline void kmemcheck_slab_free(struct kmem_cache *s, void *object, | |||
55 | { | 57 | { |
56 | } | 58 | } |
57 | 59 | ||
60 | static inline void kmemcheck_pagealloc_alloc(struct page *p, | ||
61 | unsigned int order, gfp_t gfpflags) | ||
62 | { | ||
63 | } | ||
64 | |||
58 | static inline bool kmemcheck_page_is_tracked(struct page *p) | 65 | static inline bool kmemcheck_page_is_tracked(struct page *p) |
59 | { | 66 | { |
60 | return false; | 67 | return false; |
@@ -75,6 +82,22 @@ static inline void kmemcheck_mark_initialized(void *address, unsigned int n) | |||
75 | static inline void kmemcheck_mark_freed(void *address, unsigned int n) | 82 | static inline void kmemcheck_mark_freed(void *address, unsigned int n) |
76 | { | 83 | { |
77 | } | 84 | } |
85 | |||
86 | static inline void kmemcheck_mark_unallocated_pages(struct page *p, | ||
87 | unsigned int n) | ||
88 | { | ||
89 | } | ||
90 | |||
91 | static inline void kmemcheck_mark_uninitialized_pages(struct page *p, | ||
92 | unsigned int n) | ||
93 | { | ||
94 | } | ||
95 | |||
96 | static inline void kmemcheck_mark_initialized_pages(struct page *p, | ||
97 | unsigned int n) | ||
98 | { | ||
99 | } | ||
100 | |||
78 | #endif /* CONFIG_KMEMCHECK */ | 101 | #endif /* CONFIG_KMEMCHECK */ |
79 | 102 | ||
80 | #endif /* LINUX_KMEMCHECK_H */ | 103 | #endif /* LINUX_KMEMCHECK_H */ |