diff options
Diffstat (limited to 'include/linux/page_cgroup.h')
-rw-r--r-- | include/linux/page_cgroup.h | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index a2d11771c84b..a88cdba27809 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
@@ -4,12 +4,8 @@ | |||
4 | enum { | 4 | enum { |
5 | /* flags for mem_cgroup */ | 5 | /* flags for mem_cgroup */ |
6 | PCG_LOCK, /* Lock for pc->mem_cgroup and following bits. */ | 6 | PCG_LOCK, /* Lock for pc->mem_cgroup and following bits. */ |
7 | PCG_CACHE, /* charged as cache */ | ||
8 | PCG_USED, /* this object is in use. */ | 7 | PCG_USED, /* this object is in use. */ |
9 | PCG_MIGRATION, /* under page migration */ | 8 | PCG_MIGRATION, /* under page migration */ |
10 | /* flags for mem_cgroup and file and I/O status */ | ||
11 | PCG_MOVE_LOCK, /* For race between move_account v.s. following bits */ | ||
12 | PCG_FILE_MAPPED, /* page is accounted as "mapped" */ | ||
13 | __NR_PCG_FLAGS, | 9 | __NR_PCG_FLAGS, |
14 | }; | 10 | }; |
15 | 11 | ||
@@ -64,19 +60,10 @@ static inline void ClearPageCgroup##uname(struct page_cgroup *pc) \ | |||
64 | static inline int TestClearPageCgroup##uname(struct page_cgroup *pc) \ | 60 | static inline int TestClearPageCgroup##uname(struct page_cgroup *pc) \ |
65 | { return test_and_clear_bit(PCG_##lname, &pc->flags); } | 61 | { return test_and_clear_bit(PCG_##lname, &pc->flags); } |
66 | 62 | ||
67 | /* Cache flag is set only once (at allocation) */ | ||
68 | TESTPCGFLAG(Cache, CACHE) | ||
69 | CLEARPCGFLAG(Cache, CACHE) | ||
70 | SETPCGFLAG(Cache, CACHE) | ||
71 | |||
72 | TESTPCGFLAG(Used, USED) | 63 | TESTPCGFLAG(Used, USED) |
73 | CLEARPCGFLAG(Used, USED) | 64 | CLEARPCGFLAG(Used, USED) |
74 | SETPCGFLAG(Used, USED) | 65 | SETPCGFLAG(Used, USED) |
75 | 66 | ||
76 | SETPCGFLAG(FileMapped, FILE_MAPPED) | ||
77 | CLEARPCGFLAG(FileMapped, FILE_MAPPED) | ||
78 | TESTPCGFLAG(FileMapped, FILE_MAPPED) | ||
79 | |||
80 | SETPCGFLAG(Migration, MIGRATION) | 67 | SETPCGFLAG(Migration, MIGRATION) |
81 | CLEARPCGFLAG(Migration, MIGRATION) | 68 | CLEARPCGFLAG(Migration, MIGRATION) |
82 | TESTPCGFLAG(Migration, MIGRATION) | 69 | TESTPCGFLAG(Migration, MIGRATION) |
@@ -85,7 +72,7 @@ static inline void lock_page_cgroup(struct page_cgroup *pc) | |||
85 | { | 72 | { |
86 | /* | 73 | /* |
87 | * Don't take this lock in IRQ context. | 74 | * Don't take this lock in IRQ context. |
88 | * This lock is for pc->mem_cgroup, USED, CACHE, MIGRATION | 75 | * This lock is for pc->mem_cgroup, USED, MIGRATION |
89 | */ | 76 | */ |
90 | bit_spin_lock(PCG_LOCK, &pc->flags); | 77 | bit_spin_lock(PCG_LOCK, &pc->flags); |
91 | } | 78 | } |
@@ -95,24 +82,6 @@ static inline void unlock_page_cgroup(struct page_cgroup *pc) | |||
95 | bit_spin_unlock(PCG_LOCK, &pc->flags); | 82 | bit_spin_unlock(PCG_LOCK, &pc->flags); |
96 | } | 83 | } |
97 | 84 | ||
98 | static inline void move_lock_page_cgroup(struct page_cgroup *pc, | ||
99 | unsigned long *flags) | ||
100 | { | ||
101 | /* | ||
102 | * We know updates to pc->flags of page cache's stats are from both of | ||
103 | * usual context or IRQ context. Disable IRQ to avoid deadlock. | ||
104 | */ | ||
105 | local_irq_save(*flags); | ||
106 | bit_spin_lock(PCG_MOVE_LOCK, &pc->flags); | ||
107 | } | ||
108 | |||
109 | static inline void move_unlock_page_cgroup(struct page_cgroup *pc, | ||
110 | unsigned long *flags) | ||
111 | { | ||
112 | bit_spin_unlock(PCG_MOVE_LOCK, &pc->flags); | ||
113 | local_irq_restore(*flags); | ||
114 | } | ||
115 | |||
116 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 85 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
117 | struct page_cgroup; | 86 | struct page_cgroup; |
118 | 87 | ||