aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>2012-03-21 19:34:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-21 20:55:01 -0400
commit0e79dedde951e981612ed4e6d74873d61d2a113b (patch)
treeeb759b4516068a39bc30a2e1758f0743a9c68762 /mm
parent1f2b71f41ee81735c25ef326da9a0610d640abc2 (diff)
memcg: remove unnecessary thp check in page stat accounting
Commit e94c8a9cbce1 ("memcg: make mem_cgroup_split_huge_fixup() more efficient") removed move_lock_page_cgroup(). So we do not have to check PageTransHuge in mem_cgroup_update_page_stat() and fallback into the locked accounting because both move_account() and thp split are done with compound_lock so they cannot race. The race between update vs. move is protected by mem_cgroup_stealed. PageTransHuge pages shouldn't appear in this code path currently because we are tracking only file pages at the moment but later we are planning to track also other pages (e.g. mlocked ones). Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Andrea Arcangeli <aarcange@redhat.com> Reviewed-by: Acked-by: Michal Hocko <mhocko@suse.cz> Cc: David Rientjes <rientjes@google.com> Acked-by: Ying Han<yinghan@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memcontrol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 43a9ade724c7..69af5d5801fc 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1898,7 +1898,7 @@ void mem_cgroup_update_page_stat(struct page *page,
1898 if (unlikely(!memcg || !PageCgroupUsed(pc))) 1898 if (unlikely(!memcg || !PageCgroupUsed(pc)))
1899 goto out; 1899 goto out;
1900 /* pc->mem_cgroup is unstable ? */ 1900 /* pc->mem_cgroup is unstable ? */
1901 if (unlikely(mem_cgroup_stealed(memcg)) || PageTransHuge(page)) { 1901 if (unlikely(mem_cgroup_stealed(memcg))) {
1902 /* take a lock against to access pc->mem_cgroup */ 1902 /* take a lock against to access pc->mem_cgroup */
1903 move_lock_page_cgroup(pc, &flags); 1903 move_lock_page_cgroup(pc, &flags);
1904 need_unlock = true; 1904 need_unlock = true;