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.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 3e60228e7299..b1fd5c7925fe 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -21,6 +21,9 @@ struct bio;
21#define SWAP_FLAG_PRIO_SHIFT 0 21#define SWAP_FLAG_PRIO_SHIFT 0
22#define SWAP_FLAG_DISCARD 0x10000 /* discard swap cluster after use */ 22#define SWAP_FLAG_DISCARD 0x10000 /* discard swap cluster after use */
23 23
24#define SWAP_FLAGS_VALID (SWAP_FLAG_PRIO_MASK | SWAP_FLAG_PREFER | \
25 SWAP_FLAG_DISCARD)
26
24static inline int current_is_kswapd(void) 27static inline int current_is_kswapd(void)
25{ 28{
26 return current->flags & PF_KSWAPD; 29 return current->flags & PF_KSWAPD;
@@ -223,6 +226,7 @@ extern void lru_add_page_tail(struct zone* zone,
223extern void activate_page(struct page *); 226extern void activate_page(struct page *);
224extern void mark_page_accessed(struct page *); 227extern void mark_page_accessed(struct page *);
225extern void lru_add_drain(void); 228extern void lru_add_drain(void);
229extern void lru_add_drain_cpu(int cpu);
226extern int lru_add_drain_all(void); 230extern int lru_add_drain_all(void);
227extern void rotate_reclaimable_page(struct page *page); 231extern void rotate_reclaimable_page(struct page *page);
228extern void deactivate_page(struct page *page); 232extern void deactivate_page(struct page *page);
@@ -301,6 +305,13 @@ static inline int mem_cgroup_swappiness(struct mem_cgroup *mem)
301 return vm_swappiness; 305 return vm_swappiness;
302} 306}
303#endif 307#endif
308#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
309extern void mem_cgroup_uncharge_swap(swp_entry_t ent);
310#else
311static inline void mem_cgroup_uncharge_swap(swp_entry_t ent)
312{
313}
314#endif
304#ifdef CONFIG_SWAP 315#ifdef CONFIG_SWAP
305/* linux/mm/page_io.c */ 316/* linux/mm/page_io.c */
306extern int swap_readpage(struct page *); 317extern int swap_readpage(struct page *);
@@ -329,7 +340,6 @@ extern long total_swap_pages;
329extern void si_swapinfo(struct sysinfo *); 340extern void si_swapinfo(struct sysinfo *);
330extern swp_entry_t get_swap_page(void); 341extern swp_entry_t get_swap_page(void);
331extern swp_entry_t get_swap_page_of_type(int); 342extern swp_entry_t get_swap_page_of_type(int);
332extern int valid_swaphandles(swp_entry_t, unsigned long *);
333extern int add_swap_count_continuation(swp_entry_t, gfp_t); 343extern int add_swap_count_continuation(swp_entry_t, gfp_t);
334extern void swap_shmem_alloc(swp_entry_t); 344extern void swap_shmem_alloc(swp_entry_t);
335extern int swap_duplicate(swp_entry_t); 345extern int swap_duplicate(swp_entry_t);
@@ -372,13 +382,6 @@ mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout)
372{ 382{
373} 383}
374#endif 384#endif
375#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
376extern void mem_cgroup_uncharge_swap(swp_entry_t ent);
377#else
378static inline void mem_cgroup_uncharge_swap(swp_entry_t ent)
379{
380}
381#endif
382 385
383#else /* CONFIG_SWAP */ 386#else /* CONFIG_SWAP */
384 387