diff options
Diffstat (limited to 'include/linux/page_cgroup.h')
-rw-r--r-- | include/linux/page_cgroup.h | 52 |
1 files changed, 35 insertions, 17 deletions
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index 1e6d34bfa094..602cc1fdee90 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
@@ -26,10 +26,6 @@ enum { | |||
26 | PCG_LOCK, /* page cgroup is locked */ | 26 | PCG_LOCK, /* page cgroup is locked */ |
27 | PCG_CACHE, /* charged as cache */ | 27 | PCG_CACHE, /* charged as cache */ |
28 | PCG_USED, /* this object is in use. */ | 28 | PCG_USED, /* this object is in use. */ |
29 | /* flags for LRU placement */ | ||
30 | PCG_ACTIVE, /* page is active in this cgroup */ | ||
31 | PCG_FILE, /* page is file system backed */ | ||
32 | PCG_UNEVICTABLE, /* page is unevictableable */ | ||
33 | }; | 29 | }; |
34 | 30 | ||
35 | #define TESTPCGFLAG(uname, lname) \ | 31 | #define TESTPCGFLAG(uname, lname) \ |
@@ -50,19 +46,6 @@ TESTPCGFLAG(Cache, CACHE) | |||
50 | TESTPCGFLAG(Used, USED) | 46 | TESTPCGFLAG(Used, USED) |
51 | CLEARPCGFLAG(Used, USED) | 47 | CLEARPCGFLAG(Used, USED) |
52 | 48 | ||
53 | /* LRU management flags (from global-lru definition) */ | ||
54 | TESTPCGFLAG(File, FILE) | ||
55 | SETPCGFLAG(File, FILE) | ||
56 | CLEARPCGFLAG(File, FILE) | ||
57 | |||
58 | TESTPCGFLAG(Active, ACTIVE) | ||
59 | SETPCGFLAG(Active, ACTIVE) | ||
60 | CLEARPCGFLAG(Active, ACTIVE) | ||
61 | |||
62 | TESTPCGFLAG(Unevictable, UNEVICTABLE) | ||
63 | SETPCGFLAG(Unevictable, UNEVICTABLE) | ||
64 | CLEARPCGFLAG(Unevictable, UNEVICTABLE) | ||
65 | |||
66 | static inline int page_cgroup_nid(struct page_cgroup *pc) | 49 | static inline int page_cgroup_nid(struct page_cgroup *pc) |
67 | { | 50 | { |
68 | return page_to_nid(pc->page); | 51 | return page_to_nid(pc->page); |
@@ -105,4 +88,39 @@ static inline void page_cgroup_init(void) | |||
105 | } | 88 | } |
106 | 89 | ||
107 | #endif | 90 | #endif |
91 | |||
92 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | ||
93 | #include <linux/swap.h> | ||
94 | extern struct mem_cgroup * | ||
95 | swap_cgroup_record(swp_entry_t ent, struct mem_cgroup *mem); | ||
96 | extern struct mem_cgroup *lookup_swap_cgroup(swp_entry_t ent); | ||
97 | extern int swap_cgroup_swapon(int type, unsigned long max_pages); | ||
98 | extern void swap_cgroup_swapoff(int type); | ||
99 | #else | ||
100 | #include <linux/swap.h> | ||
101 | |||
102 | static inline | ||
103 | struct mem_cgroup *swap_cgroup_record(swp_entry_t ent, struct mem_cgroup *mem) | ||
104 | { | ||
105 | return NULL; | ||
106 | } | ||
107 | |||
108 | static inline | ||
109 | struct mem_cgroup *lookup_swap_cgroup(swp_entry_t ent) | ||
110 | { | ||
111 | return NULL; | ||
112 | } | ||
113 | |||
114 | static inline int | ||
115 | swap_cgroup_swapon(int type, unsigned long max_pages) | ||
116 | { | ||
117 | return 0; | ||
118 | } | ||
119 | |||
120 | static inline void swap_cgroup_swapoff(int type) | ||
121 | { | ||
122 | return; | ||
123 | } | ||
124 | |||
125 | #endif | ||
108 | #endif | 126 | #endif |