diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2012-01-12 20:19:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-12 23:13:07 -0500 |
commit | 38c5d72f3ebe5ddd57d2f08dc035070fc6c9a287 (patch) | |
tree | 6461c0dfec95dccc92191f059fbe99b5660a8860 /include | |
parent | 4e5f01c2b9b94321992acb09c35d34f5ee5bb274 (diff) |
memcg: simplify LRU handling by new rule
Now, at LRU handling, memory cgroup needs to do complicated works to see
valid pc->mem_cgroup, which may be overwritten.
This patch is for relaxing the protocol. This patch guarantees
- when pc->mem_cgroup is overwritten, page must not be on LRU.
By this, LRU routine can believe pc->mem_cgroup and don't need to check
bits on pc->flags. This new rule may adds small overheads to swapin. But
in most case, lru handling gets faster.
After this patch, PCG_ACCT_LRU bit is obsolete and removed.
[akpm@linux-foundation.org: remove unneeded VM_BUG_ON(), restore hannes's christmas tree]
[akpm@linux-foundation.org: clean up code comment]
[hughd@google.com: fix NULL mem_cgroup_try_charge]
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Acked-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Ying Han <yinghan@google.com>
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/page_cgroup.h | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index 1153095ee457..a2d11771c84b 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
@@ -10,8 +10,6 @@ enum { | |||
10 | /* flags for mem_cgroup and file and I/O status */ | 10 | /* flags for mem_cgroup and file and I/O status */ |
11 | PCG_MOVE_LOCK, /* For race between move_account v.s. following bits */ | 11 | PCG_MOVE_LOCK, /* For race between move_account v.s. following bits */ |
12 | PCG_FILE_MAPPED, /* page is accounted as "mapped" */ | 12 | PCG_FILE_MAPPED, /* page is accounted as "mapped" */ |
13 | /* No lock in page_cgroup */ | ||
14 | PCG_ACCT_LRU, /* page has been accounted for (under lru_lock) */ | ||
15 | __NR_PCG_FLAGS, | 13 | __NR_PCG_FLAGS, |
16 | }; | 14 | }; |
17 | 15 | ||
@@ -75,12 +73,6 @@ TESTPCGFLAG(Used, USED) | |||
75 | CLEARPCGFLAG(Used, USED) | 73 | CLEARPCGFLAG(Used, USED) |
76 | SETPCGFLAG(Used, USED) | 74 | SETPCGFLAG(Used, USED) |
77 | 75 | ||
78 | SETPCGFLAG(AcctLRU, ACCT_LRU) | ||
79 | CLEARPCGFLAG(AcctLRU, ACCT_LRU) | ||
80 | TESTPCGFLAG(AcctLRU, ACCT_LRU) | ||
81 | TESTCLEARPCGFLAG(AcctLRU, ACCT_LRU) | ||
82 | |||
83 | |||
84 | SETPCGFLAG(FileMapped, FILE_MAPPED) | 76 | SETPCGFLAG(FileMapped, FILE_MAPPED) |
85 | CLEARPCGFLAG(FileMapped, FILE_MAPPED) | 77 | CLEARPCGFLAG(FileMapped, FILE_MAPPED) |
86 | TESTPCGFLAG(FileMapped, FILE_MAPPED) | 78 | TESTPCGFLAG(FileMapped, FILE_MAPPED) |