diff options
Diffstat (limited to 'include/linux/swap.h')
-rw-r--r-- | include/linux/swap.h | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h index 384eb5fe530b..14d62490922e 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -9,7 +9,7 @@ | |||
9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
10 | #include <linux/node.h> | 10 | #include <linux/node.h> |
11 | 11 | ||
12 | #include <asm/atomic.h> | 12 | #include <linux/atomic.h> |
13 | #include <asm/page.h> | 13 | #include <asm/page.h> |
14 | 14 | ||
15 | struct notifier_block; | 15 | struct notifier_block; |
@@ -251,14 +251,6 @@ static inline void lru_cache_add_file(struct page *page) | |||
251 | /* linux/mm/vmscan.c */ | 251 | /* linux/mm/vmscan.c */ |
252 | extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, | 252 | extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, |
253 | gfp_t gfp_mask, nodemask_t *mask); | 253 | gfp_t gfp_mask, nodemask_t *mask); |
254 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, | ||
255 | gfp_t gfp_mask, bool noswap, | ||
256 | unsigned int swappiness); | ||
257 | extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, | ||
258 | gfp_t gfp_mask, bool noswap, | ||
259 | unsigned int swappiness, | ||
260 | struct zone *zone, | ||
261 | unsigned long *nr_scanned); | ||
262 | extern int __isolate_lru_page(struct page *page, int mode, int file); | 254 | extern int __isolate_lru_page(struct page *page, int mode, int file); |
263 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 255 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
264 | extern int vm_swappiness; | 256 | extern int vm_swappiness; |
@@ -299,17 +291,14 @@ static inline void scan_unevictable_unregister_node(struct node *node) | |||
299 | 291 | ||
300 | extern int kswapd_run(int nid); | 292 | extern int kswapd_run(int nid); |
301 | extern void kswapd_stop(int nid); | 293 | extern void kswapd_stop(int nid); |
302 | |||
303 | #ifdef CONFIG_MMU | ||
304 | /* linux/mm/shmem.c */ | ||
305 | extern int shmem_unuse(swp_entry_t entry, struct page *page); | ||
306 | #endif /* CONFIG_MMU */ | ||
307 | |||
308 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | 294 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR |
309 | extern void mem_cgroup_get_shmem_target(struct inode *inode, pgoff_t pgoff, | 295 | extern int mem_cgroup_swappiness(struct mem_cgroup *mem); |
310 | struct page **pagep, swp_entry_t *ent); | 296 | #else |
297 | static inline int mem_cgroup_swappiness(struct mem_cgroup *mem) | ||
298 | { | ||
299 | return vm_swappiness; | ||
300 | } | ||
311 | #endif | 301 | #endif |
312 | |||
313 | #ifdef CONFIG_SWAP | 302 | #ifdef CONFIG_SWAP |
314 | /* linux/mm/page_io.c */ | 303 | /* linux/mm/page_io.c */ |
315 | extern int swap_readpage(struct page *); | 304 | extern int swap_readpage(struct page *); |
@@ -358,6 +347,7 @@ struct backing_dev_info; | |||
358 | extern struct mm_struct *swap_token_mm; | 347 | extern struct mm_struct *swap_token_mm; |
359 | extern void grab_swap_token(struct mm_struct *); | 348 | extern void grab_swap_token(struct mm_struct *); |
360 | extern void __put_swap_token(struct mm_struct *); | 349 | extern void __put_swap_token(struct mm_struct *); |
350 | extern void disable_swap_token(struct mem_cgroup *memcg); | ||
361 | 351 | ||
362 | static inline int has_swap_token(struct mm_struct *mm) | 352 | static inline int has_swap_token(struct mm_struct *mm) |
363 | { | 353 | { |
@@ -370,11 +360,6 @@ static inline void put_swap_token(struct mm_struct *mm) | |||
370 | __put_swap_token(mm); | 360 | __put_swap_token(mm); |
371 | } | 361 | } |
372 | 362 | ||
373 | static inline void disable_swap_token(void) | ||
374 | { | ||
375 | put_swap_token(swap_token_mm); | ||
376 | } | ||
377 | |||
378 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | 363 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR |
379 | extern void | 364 | extern void |
380 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); | 365 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); |
@@ -500,7 +485,7 @@ static inline int has_swap_token(struct mm_struct *mm) | |||
500 | return 0; | 485 | return 0; |
501 | } | 486 | } |
502 | 487 | ||
503 | static inline void disable_swap_token(void) | 488 | static inline void disable_swap_token(struct mem_cgroup *memcg) |
504 | { | 489 | { |
505 | } | 490 | } |
506 | 491 | ||