diff options
Diffstat (limited to 'include/linux/memcontrol.h')
-rw-r--r-- | include/linux/memcontrol.h | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 5e9840f50980..50940da6adf3 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef _LINUX_MEMCONTROL_H | 20 | #ifndef _LINUX_MEMCONTROL_H |
21 | #define _LINUX_MEMCONTROL_H | 21 | #define _LINUX_MEMCONTROL_H |
22 | #include <linux/cgroup.h> | 22 | #include <linux/cgroup.h> |
23 | #include <linux/vm_event_item.h> | ||
24 | |||
23 | struct mem_cgroup; | 25 | struct mem_cgroup; |
24 | struct page_cgroup; | 26 | struct page_cgroup; |
25 | struct page; | 27 | struct page; |
@@ -82,6 +84,7 @@ int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | |||
82 | 84 | ||
83 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); | 85 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); |
84 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); | 86 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); |
87 | extern struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm); | ||
85 | 88 | ||
86 | static inline | 89 | static inline |
87 | int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) | 90 | int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) |
@@ -106,9 +109,10 @@ extern void mem_cgroup_end_migration(struct mem_cgroup *mem, | |||
106 | */ | 109 | */ |
107 | int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); | 110 | int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); |
108 | int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); | 111 | int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); |
109 | unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, | 112 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); |
110 | struct zone *zone, | 113 | unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, |
111 | enum lru_list lru); | 114 | struct zone *zone, |
115 | enum lru_list lru); | ||
112 | struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, | 116 | struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, |
113 | struct zone *zone); | 117 | struct zone *zone); |
114 | struct zone_reclaim_stat* | 118 | struct zone_reclaim_stat* |
@@ -144,9 +148,11 @@ static inline void mem_cgroup_dec_page_stat(struct page *page, | |||
144 | } | 148 | } |
145 | 149 | ||
146 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | 150 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, |
147 | gfp_t gfp_mask); | 151 | gfp_t gfp_mask, |
152 | unsigned long *total_scanned); | ||
148 | u64 mem_cgroup_get_limit(struct mem_cgroup *mem); | 153 | u64 mem_cgroup_get_limit(struct mem_cgroup *mem); |
149 | 154 | ||
155 | void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); | ||
150 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 156 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
151 | void mem_cgroup_split_huge_fixup(struct page *head, struct page *tail); | 157 | void mem_cgroup_split_huge_fixup(struct page *head, struct page *tail); |
152 | #endif | 158 | #endif |
@@ -241,6 +247,11 @@ static inline struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page) | |||
241 | return NULL; | 247 | return NULL; |
242 | } | 248 | } |
243 | 249 | ||
250 | static inline struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm) | ||
251 | { | ||
252 | return NULL; | ||
253 | } | ||
254 | |||
244 | static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) | 255 | static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) |
245 | { | 256 | { |
246 | return 1; | 257 | return 1; |
@@ -302,8 +313,8 @@ mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg) | |||
302 | } | 313 | } |
303 | 314 | ||
304 | static inline unsigned long | 315 | static inline unsigned long |
305 | mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, struct zone *zone, | 316 | mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, struct zone *zone, |
306 | enum lru_list lru) | 317 | enum lru_list lru) |
307 | { | 318 | { |
308 | return 0; | 319 | return 0; |
309 | } | 320 | } |
@@ -338,7 +349,8 @@ static inline void mem_cgroup_dec_page_stat(struct page *page, | |||
338 | 349 | ||
339 | static inline | 350 | static inline |
340 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | 351 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, |
341 | gfp_t gfp_mask) | 352 | gfp_t gfp_mask, |
353 | unsigned long *total_scanned) | ||
342 | { | 354 | { |
343 | return 0; | 355 | return 0; |
344 | } | 356 | } |
@@ -354,6 +366,10 @@ static inline void mem_cgroup_split_huge_fixup(struct page *head, | |||
354 | { | 366 | { |
355 | } | 367 | } |
356 | 368 | ||
369 | static inline | ||
370 | void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx) | ||
371 | { | ||
372 | } | ||
357 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 373 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
358 | 374 | ||
359 | #if !defined(CONFIG_CGROUP_MEM_RES_CTLR) || !defined(CONFIG_DEBUG_VM) | 375 | #if !defined(CONFIG_CGROUP_MEM_RES_CTLR) || !defined(CONFIG_DEBUG_VM) |