aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/page_cgroup.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
index b02195dfc1b0..fdb5a92b5ac7 100644
--- a/include/linux/page_cgroup.h
+++ b/include/linux/page_cgroup.h
@@ -40,6 +40,9 @@ enum {
40 PCG_USED, /* this object is in use. */ 40 PCG_USED, /* this object is in use. */
41 PCG_ACCT_LRU, /* page has been accounted for */ 41 PCG_ACCT_LRU, /* page has been accounted for */
42 PCG_FILE_MAPPED, /* page is accounted as "mapped" */ 42 PCG_FILE_MAPPED, /* page is accounted as "mapped" */
43 PCG_FILE_DIRTY, /* page is dirty */
44 PCG_FILE_WRITEBACK, /* page is under writeback */
45 PCG_FILE_UNSTABLE_NFS, /* page is NFS unstable */
43 PCG_MIGRATION, /* under page migration */ 46 PCG_MIGRATION, /* under page migration */
44}; 47};
45 48
@@ -59,6 +62,10 @@ static inline void ClearPageCgroup##uname(struct page_cgroup *pc) \
59static inline int TestClearPageCgroup##uname(struct page_cgroup *pc) \ 62static inline int TestClearPageCgroup##uname(struct page_cgroup *pc) \
60 { return test_and_clear_bit(PCG_##lname, &pc->flags); } 63 { return test_and_clear_bit(PCG_##lname, &pc->flags); }
61 64
65#define TESTSETPCGFLAG(uname, lname) \
66static inline int TestSetPageCgroup##uname(struct page_cgroup *pc) \
67 { return test_and_set_bit(PCG_##lname, &pc->flags); }
68
62/* Cache flag is set only once (at allocation) */ 69/* Cache flag is set only once (at allocation) */
63TESTPCGFLAG(Cache, CACHE) 70TESTPCGFLAG(Cache, CACHE)
64CLEARPCGFLAG(Cache, CACHE) 71CLEARPCGFLAG(Cache, CACHE)
@@ -78,6 +85,22 @@ SETPCGFLAG(FileMapped, FILE_MAPPED)
78CLEARPCGFLAG(FileMapped, FILE_MAPPED) 85CLEARPCGFLAG(FileMapped, FILE_MAPPED)
79TESTPCGFLAG(FileMapped, FILE_MAPPED) 86TESTPCGFLAG(FileMapped, FILE_MAPPED)
80 87
88SETPCGFLAG(FileDirty, FILE_DIRTY)
89CLEARPCGFLAG(FileDirty, FILE_DIRTY)
90TESTPCGFLAG(FileDirty, FILE_DIRTY)
91TESTCLEARPCGFLAG(FileDirty, FILE_DIRTY)
92TESTSETPCGFLAG(FileDirty, FILE_DIRTY)
93
94SETPCGFLAG(FileWriteback, FILE_WRITEBACK)
95CLEARPCGFLAG(FileWriteback, FILE_WRITEBACK)
96TESTPCGFLAG(FileWriteback, FILE_WRITEBACK)
97
98SETPCGFLAG(FileUnstableNFS, FILE_UNSTABLE_NFS)
99CLEARPCGFLAG(FileUnstableNFS, FILE_UNSTABLE_NFS)
100TESTPCGFLAG(FileUnstableNFS, FILE_UNSTABLE_NFS)
101TESTCLEARPCGFLAG(FileUnstableNFS, FILE_UNSTABLE_NFS)
102TESTSETPCGFLAG(FileUnstableNFS, FILE_UNSTABLE_NFS)
103
81SETPCGFLAG(Migration, MIGRATION) 104SETPCGFLAG(Migration, MIGRATION)
82CLEARPCGFLAG(Migration, MIGRATION) 105CLEARPCGFLAG(Migration, MIGRATION)
83TESTPCGFLAG(Migration, MIGRATION) 106TESTPCGFLAG(Migration, MIGRATION)