diff options
Diffstat (limited to 'include/linux/swap.h')
-rw-r--r-- | include/linux/swap.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h index 91dee50fe260..d30215578877 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -214,7 +214,8 @@ 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 | unsigned int swappiness); | ||
218 | extern int __isolate_lru_page(struct page *page, int mode, int file); | 219 | extern int __isolate_lru_page(struct page *page, int mode, int file); |
219 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 220 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
220 | extern int vm_swappiness; | 221 | extern int vm_swappiness; |
@@ -333,6 +334,22 @@ static inline void disable_swap_token(void) | |||
333 | put_swap_token(swap_token_mm); | 334 | put_swap_token(swap_token_mm); |
334 | } | 335 | } |
335 | 336 | ||
337 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | ||
338 | extern void mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent); | ||
339 | #else | ||
340 | static inline void | ||
341 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) | ||
342 | { | ||
343 | } | ||
344 | #endif | ||
345 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | ||
346 | extern void mem_cgroup_uncharge_swap(swp_entry_t ent); | ||
347 | #else | ||
348 | static inline void mem_cgroup_uncharge_swap(swp_entry_t ent) | ||
349 | { | ||
350 | } | ||
351 | #endif | ||
352 | |||
336 | #else /* CONFIG_SWAP */ | 353 | #else /* CONFIG_SWAP */ |
337 | 354 | ||
338 | #define nr_swap_pages 0L | 355 | #define nr_swap_pages 0L |
@@ -409,6 +426,12 @@ static inline swp_entry_t get_swap_page(void) | |||
409 | #define has_swap_token(x) 0 | 426 | #define has_swap_token(x) 0 |
410 | #define disable_swap_token() do { } while(0) | 427 | #define disable_swap_token() do { } while(0) |
411 | 428 | ||
429 | static inline int mem_cgroup_cache_charge_swapin(struct page *page, | ||
430 | struct mm_struct *mm, gfp_t mask, bool locked) | ||
431 | { | ||
432 | return 0; | ||
433 | } | ||
434 | |||
412 | #endif /* CONFIG_SWAP */ | 435 | #endif /* CONFIG_SWAP */ |
413 | #endif /* __KERNEL__*/ | 436 | #endif /* __KERNEL__*/ |
414 | #endif /* _LINUX_SWAP_H */ | 437 | #endif /* _LINUX_SWAP_H */ |