diff options
Diffstat (limited to 'include/linux/memcontrol.h')
-rw-r--r-- | include/linux/memcontrol.h | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 04075628cb9a..8b1c4295848b 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -25,18 +25,20 @@ struct page_cgroup; | |||
25 | struct page; | 25 | struct page; |
26 | struct mm_struct; | 26 | struct mm_struct; |
27 | 27 | ||
28 | #ifdef CONFIG_CGROUP_MEM_CONT | 28 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR |
29 | 29 | ||
30 | extern void mm_init_cgroup(struct mm_struct *mm, struct task_struct *p); | 30 | extern void mm_init_cgroup(struct mm_struct *mm, struct task_struct *p); |
31 | extern void mm_free_cgroup(struct mm_struct *mm); | 31 | extern void mm_free_cgroup(struct mm_struct *mm); |
32 | extern void page_assign_page_cgroup(struct page *page, | 32 | |
33 | struct page_cgroup *pc); | 33 | #define page_reset_bad_cgroup(page) ((page)->page_cgroup = 0) |
34 | |||
34 | extern struct page_cgroup *page_get_page_cgroup(struct page *page); | 35 | extern struct page_cgroup *page_get_page_cgroup(struct page *page); |
35 | extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm, | 36 | extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm, |
36 | gfp_t gfp_mask); | 37 | gfp_t gfp_mask); |
37 | extern void mem_cgroup_uncharge(struct page_cgroup *pc); | 38 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, |
39 | gfp_t gfp_mask); | ||
38 | extern void mem_cgroup_uncharge_page(struct page *page); | 40 | extern void mem_cgroup_uncharge_page(struct page *page); |
39 | extern void mem_cgroup_move_lists(struct page_cgroup *pc, bool active); | 41 | extern void mem_cgroup_move_lists(struct page *page, bool active); |
40 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | 42 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, |
41 | struct list_head *dst, | 43 | struct list_head *dst, |
42 | unsigned long *scanned, int order, | 44 | unsigned long *scanned, int order, |
@@ -44,11 +46,9 @@ extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | |||
44 | struct mem_cgroup *mem_cont, | 46 | struct mem_cgroup *mem_cont, |
45 | int active); | 47 | int active); |
46 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); | 48 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); |
47 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, | ||
48 | gfp_t gfp_mask); | ||
49 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | 49 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); |
50 | 50 | ||
51 | #define vm_match_cgroup(mm, cgroup) \ | 51 | #define mm_match_cgroup(mm, cgroup) \ |
52 | ((cgroup) == rcu_dereference((mm)->mem_cgroup)) | 52 | ((cgroup) == rcu_dereference((mm)->mem_cgroup)) |
53 | 53 | ||
54 | extern int mem_cgroup_prepare_migration(struct page *page); | 54 | extern int mem_cgroup_prepare_migration(struct page *page); |
@@ -72,7 +72,7 @@ extern long mem_cgroup_calc_reclaim_active(struct mem_cgroup *mem, | |||
72 | extern long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem, | 72 | extern long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem, |
73 | struct zone *zone, int priority); | 73 | struct zone *zone, int priority); |
74 | 74 | ||
75 | #else /* CONFIG_CGROUP_MEM_CONT */ | 75 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
76 | static inline void mm_init_cgroup(struct mm_struct *mm, | 76 | static inline void mm_init_cgroup(struct mm_struct *mm, |
77 | struct task_struct *p) | 77 | struct task_struct *p) |
78 | { | 78 | { |
@@ -82,8 +82,7 @@ static inline void mm_free_cgroup(struct mm_struct *mm) | |||
82 | { | 82 | { |
83 | } | 83 | } |
84 | 84 | ||
85 | static inline void page_assign_page_cgroup(struct page *page, | 85 | static inline void page_reset_bad_cgroup(struct page *page) |
86 | struct page_cgroup *pc) | ||
87 | { | 86 | { |
88 | } | 87 | } |
89 | 88 | ||
@@ -92,33 +91,27 @@ static inline struct page_cgroup *page_get_page_cgroup(struct page *page) | |||
92 | return NULL; | 91 | return NULL; |
93 | } | 92 | } |
94 | 93 | ||
95 | static inline int mem_cgroup_charge(struct page *page, struct mm_struct *mm, | 94 | static inline int mem_cgroup_charge(struct page *page, |
96 | gfp_t gfp_mask) | 95 | struct mm_struct *mm, gfp_t gfp_mask) |
97 | { | 96 | { |
98 | return 0; | 97 | return 0; |
99 | } | 98 | } |
100 | 99 | ||
101 | static inline void mem_cgroup_uncharge(struct page_cgroup *pc) | 100 | static inline int mem_cgroup_cache_charge(struct page *page, |
101 | struct mm_struct *mm, gfp_t gfp_mask) | ||
102 | { | 102 | { |
103 | return 0; | ||
103 | } | 104 | } |
104 | 105 | ||
105 | static inline void mem_cgroup_uncharge_page(struct page *page) | 106 | static inline void mem_cgroup_uncharge_page(struct page *page) |
106 | { | 107 | { |
107 | } | 108 | } |
108 | 109 | ||
109 | static inline void mem_cgroup_move_lists(struct page_cgroup *pc, | 110 | static inline void mem_cgroup_move_lists(struct page *page, bool active) |
110 | bool active) | ||
111 | { | ||
112 | } | ||
113 | |||
114 | static inline int mem_cgroup_cache_charge(struct page *page, | ||
115 | struct mm_struct *mm, | ||
116 | gfp_t gfp_mask) | ||
117 | { | 111 | { |
118 | return 0; | ||
119 | } | 112 | } |
120 | 113 | ||
121 | static inline int vm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) | 114 | static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) |
122 | { | 115 | { |
123 | return 1; | 116 | return 1; |
124 | } | 117 | } |