diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/memcontrol.h | 11 | ||||
-rw-r--r-- | include/linux/swap.h | 14 |
2 files changed, 20 insertions, 5 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 41b46cc9d1f1..ca51ac72d6c0 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -32,6 +32,8 @@ extern int mem_cgroup_newpage_charge(struct page *page, struct mm_struct *mm, | |||
32 | /* for swap handling */ | 32 | /* for swap handling */ |
33 | extern int mem_cgroup_try_charge(struct mm_struct *mm, | 33 | extern int mem_cgroup_try_charge(struct mm_struct *mm, |
34 | gfp_t gfp_mask, struct mem_cgroup **ptr); | 34 | gfp_t gfp_mask, struct mem_cgroup **ptr); |
35 | extern int mem_cgroup_try_charge_swapin(struct mm_struct *mm, | ||
36 | struct page *page, gfp_t mask, struct mem_cgroup **ptr); | ||
35 | extern void mem_cgroup_commit_charge_swapin(struct page *page, | 37 | extern void mem_cgroup_commit_charge_swapin(struct page *page, |
36 | struct mem_cgroup *ptr); | 38 | struct mem_cgroup *ptr); |
37 | extern void mem_cgroup_cancel_charge_swapin(struct mem_cgroup *ptr); | 39 | extern void mem_cgroup_cancel_charge_swapin(struct mem_cgroup *ptr); |
@@ -80,7 +82,6 @@ extern long mem_cgroup_calc_reclaim(struct mem_cgroup *mem, struct zone *zone, | |||
80 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | 82 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP |
81 | extern int do_swap_account; | 83 | extern int do_swap_account; |
82 | #endif | 84 | #endif |
83 | |||
84 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 85 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
85 | struct mem_cgroup; | 86 | struct mem_cgroup; |
86 | 87 | ||
@@ -97,7 +98,13 @@ static inline int mem_cgroup_cache_charge(struct page *page, | |||
97 | } | 98 | } |
98 | 99 | ||
99 | static inline int mem_cgroup_try_charge(struct mm_struct *mm, | 100 | static inline int mem_cgroup_try_charge(struct mm_struct *mm, |
100 | gfp_t gfp_mask, struct mem_cgroup **ptr) | 101 | gfp_t gfp_mask, struct mem_cgroup **ptr) |
102 | { | ||
103 | return 0; | ||
104 | } | ||
105 | |||
106 | static inline int mem_cgroup_try_charge_swapin(struct mm_struct *mm, | ||
107 | struct page *page, gfp_t gfp_mask, struct mem_cgroup **ptr) | ||
101 | { | 108 | { |
102 | return 0; | 109 | return 0; |
103 | } | 110 | } |
diff --git a/include/linux/swap.h b/include/linux/swap.h index f8f3907533f0..be938ce4895a 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -214,7 +214,7 @@ static inline void lru_cache_add_active_file(struct page *page) | |||
214 | extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, | 214 | extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, |
215 | gfp_t gfp_mask); | 215 | gfp_t gfp_mask); |
216 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, | 216 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, |
217 | gfp_t gfp_mask); | 217 | gfp_t gfp_mask, bool noswap); |
218 | extern int __isolate_lru_page(struct page *page, int mode, int file); | 218 | extern int __isolate_lru_page(struct page *page, int mode, int file); |
219 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 219 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
220 | extern int vm_swappiness; | 220 | extern int vm_swappiness; |
@@ -336,7 +336,7 @@ static inline void disable_swap_token(void) | |||
336 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | 336 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR |
337 | extern int mem_cgroup_cache_charge_swapin(struct page *page, | 337 | extern int mem_cgroup_cache_charge_swapin(struct page *page, |
338 | struct mm_struct *mm, gfp_t mask, bool locked); | 338 | struct mm_struct *mm, gfp_t mask, bool locked); |
339 | extern void mem_cgroup_uncharge_swapcache(struct page *page); | 339 | extern void mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent); |
340 | #else | 340 | #else |
341 | static inline | 341 | static inline |
342 | int mem_cgroup_cache_charge_swapin(struct page *page, | 342 | int mem_cgroup_cache_charge_swapin(struct page *page, |
@@ -344,7 +344,15 @@ int mem_cgroup_cache_charge_swapin(struct page *page, | |||
344 | { | 344 | { |
345 | return 0; | 345 | return 0; |
346 | } | 346 | } |
347 | static inline void mem_cgroup_uncharge_swapcache(struct page *page) | 347 | static inline void |
348 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) | ||
349 | { | ||
350 | } | ||
351 | #endif | ||
352 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | ||
353 | extern void mem_cgroup_uncharge_swap(swp_entry_t ent); | ||
354 | #else | ||
355 | static inline void mem_cgroup_uncharge_swap(swp_entry_t ent) | ||
348 | { | 356 | { |
349 | } | 357 | } |
350 | #endif | 358 | #endif |