aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/swap.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/swap.h')
-rw-r--r--include/linux/swap.h33
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
15struct notifier_block; 15struct 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 */
252extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, 252extern 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);
254extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem,
255 gfp_t gfp_mask, bool noswap,
256 unsigned int swappiness);
257extern 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);
262extern int __isolate_lru_page(struct page *page, int mode, int file); 254extern int __isolate_lru_page(struct page *page, int mode, int file);
263extern unsigned long shrink_all_memory(unsigned long nr_pages); 255extern unsigned long shrink_all_memory(unsigned long nr_pages);
264extern int vm_swappiness; 256extern int vm_swappiness;
@@ -299,17 +291,14 @@ static inline void scan_unevictable_unregister_node(struct node *node)
299 291
300extern int kswapd_run(int nid); 292extern int kswapd_run(int nid);
301extern void kswapd_stop(int nid); 293extern void kswapd_stop(int nid);
302
303#ifdef CONFIG_MMU
304/* linux/mm/shmem.c */
305extern 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
309extern void mem_cgroup_get_shmem_target(struct inode *inode, pgoff_t pgoff, 295extern int mem_cgroup_swappiness(struct mem_cgroup *mem);
310 struct page **pagep, swp_entry_t *ent); 296#else
297static 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 */
315extern int swap_readpage(struct page *); 304extern int swap_readpage(struct page *);
@@ -358,6 +347,7 @@ struct backing_dev_info;
358extern struct mm_struct *swap_token_mm; 347extern struct mm_struct *swap_token_mm;
359extern void grab_swap_token(struct mm_struct *); 348extern void grab_swap_token(struct mm_struct *);
360extern void __put_swap_token(struct mm_struct *); 349extern void __put_swap_token(struct mm_struct *);
350extern void disable_swap_token(struct mem_cgroup *memcg);
361 351
362static inline int has_swap_token(struct mm_struct *mm) 352static 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
373static 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
379extern void 364extern void
380mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); 365mem_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
503static inline void disable_swap_token(void) 488static inline void disable_swap_token(struct mem_cgroup *memcg)
504{ 489{
505} 490}
506 491