diff options
Diffstat (limited to 'include/linux/swap.h')
-rw-r--r-- | include/linux/swap.h | 56 |
1 files changed, 9 insertions, 47 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h index b1fd5c7925fe..b6661933e252 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -221,8 +221,8 @@ extern unsigned int nr_free_pagecache_pages(void); | |||
221 | /* linux/mm/swap.c */ | 221 | /* linux/mm/swap.c */ |
222 | extern void __lru_cache_add(struct page *, enum lru_list lru); | 222 | extern void __lru_cache_add(struct page *, enum lru_list lru); |
223 | extern void lru_cache_add_lru(struct page *, enum lru_list lru); | 223 | extern void lru_cache_add_lru(struct page *, enum lru_list lru); |
224 | extern void lru_add_page_tail(struct zone* zone, | 224 | extern void lru_add_page_tail(struct page *page, struct page *page_tail, |
225 | struct page *page, struct page *page_tail); | 225 | struct lruvec *lruvec); |
226 | extern void activate_page(struct page *); | 226 | extern void activate_page(struct page *); |
227 | extern void mark_page_accessed(struct page *); | 227 | extern void mark_page_accessed(struct page *); |
228 | extern void lru_add_drain(void); | 228 | extern void lru_add_drain(void); |
@@ -251,7 +251,7 @@ 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 int __isolate_lru_page(struct page *page, isolate_mode_t mode, int file); | 254 | extern int __isolate_lru_page(struct page *page, isolate_mode_t mode); |
255 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, | 255 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, |
256 | gfp_t gfp_mask, bool noswap); | 256 | gfp_t gfp_mask, bool noswap); |
257 | extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, | 257 | extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, |
@@ -351,31 +351,14 @@ extern int swap_type_of(dev_t, sector_t, struct block_device **); | |||
351 | extern unsigned int count_swap_pages(int, int); | 351 | extern unsigned int count_swap_pages(int, int); |
352 | extern sector_t map_swap_page(struct page *, struct block_device **); | 352 | extern sector_t map_swap_page(struct page *, struct block_device **); |
353 | extern sector_t swapdev_block(int, pgoff_t); | 353 | extern sector_t swapdev_block(int, pgoff_t); |
354 | extern int page_swapcount(struct page *); | ||
354 | extern int reuse_swap_page(struct page *); | 355 | extern int reuse_swap_page(struct page *); |
355 | extern int try_to_free_swap(struct page *); | 356 | extern int try_to_free_swap(struct page *); |
356 | struct backing_dev_info; | 357 | struct backing_dev_info; |
357 | 358 | ||
358 | /* linux/mm/thrash.c */ | ||
359 | extern struct mm_struct *swap_token_mm; | ||
360 | extern void grab_swap_token(struct mm_struct *); | ||
361 | extern void __put_swap_token(struct mm_struct *); | ||
362 | extern void disable_swap_token(struct mem_cgroup *memcg); | ||
363 | |||
364 | static inline int has_swap_token(struct mm_struct *mm) | ||
365 | { | ||
366 | return (mm == swap_token_mm); | ||
367 | } | ||
368 | |||
369 | static inline void put_swap_token(struct mm_struct *mm) | ||
370 | { | ||
371 | if (has_swap_token(mm)) | ||
372 | __put_swap_token(mm); | ||
373 | } | ||
374 | |||
375 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | 359 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR |
376 | extern void | 360 | extern void |
377 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); | 361 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); |
378 | extern int mem_cgroup_count_swap_user(swp_entry_t ent, struct page **pagep); | ||
379 | #else | 362 | #else |
380 | static inline void | 363 | static inline void |
381 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout) | 364 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout) |
@@ -462,6 +445,11 @@ static inline void delete_from_swap_cache(struct page *page) | |||
462 | { | 445 | { |
463 | } | 446 | } |
464 | 447 | ||
448 | static inline int page_swapcount(struct page *page) | ||
449 | { | ||
450 | return 0; | ||
451 | } | ||
452 | |||
465 | #define reuse_swap_page(page) (page_mapcount(page) == 1) | 453 | #define reuse_swap_page(page) (page_mapcount(page) == 1) |
466 | 454 | ||
467 | static inline int try_to_free_swap(struct page *page) | 455 | static inline int try_to_free_swap(struct page *page) |
@@ -476,37 +464,11 @@ static inline swp_entry_t get_swap_page(void) | |||
476 | return entry; | 464 | return entry; |
477 | } | 465 | } |
478 | 466 | ||
479 | /* linux/mm/thrash.c */ | ||
480 | static inline void put_swap_token(struct mm_struct *mm) | ||
481 | { | ||
482 | } | ||
483 | |||
484 | static inline void grab_swap_token(struct mm_struct *mm) | ||
485 | { | ||
486 | } | ||
487 | |||
488 | static inline int has_swap_token(struct mm_struct *mm) | ||
489 | { | ||
490 | return 0; | ||
491 | } | ||
492 | |||
493 | static inline void disable_swap_token(struct mem_cgroup *memcg) | ||
494 | { | ||
495 | } | ||
496 | |||
497 | static inline void | 467 | static inline void |
498 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) | 468 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) |
499 | { | 469 | { |
500 | } | 470 | } |
501 | 471 | ||
502 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | ||
503 | static inline int | ||
504 | mem_cgroup_count_swap_user(swp_entry_t ent, struct page **pagep) | ||
505 | { | ||
506 | return 0; | ||
507 | } | ||
508 | #endif | ||
509 | |||
510 | #endif /* CONFIG_SWAP */ | 472 | #endif /* CONFIG_SWAP */ |
511 | #endif /* __KERNEL__*/ | 473 | #endif /* __KERNEL__*/ |
512 | #endif /* _LINUX_SWAP_H */ | 474 | #endif /* _LINUX_SWAP_H */ |