lkml.org 
[lkml]   [2012]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH v3] memcg: remove unnecessary thp check at page stat accounting
Updated description.
==
From a6395205d9f517af7963ff61d66efbcf1c64b2a5 Mon Sep 17 00:00:00 2001
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Date: Thu, 12 Jan 2012 16:08:33 +0900
Subject: [PATCH v3] memcg: remove unnecessary check in mem_cgroup_update_page_stat()

This patch is a fix for
memcg: make mem_cgroup_split_huge_fixup() more efficient

Above patch removes 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).

Changelog:
- updated description.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
mm/memcontrol.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 3dbff4d..ff24520 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1867,7 +1867,7 @@ void mem_cgroup_update_page_stat(struct page *page,
if (unlikely(!memcg || !PageCgroupUsed(pc)))
goto out;
/* pc->mem_cgroup is unstable ? */
- if (unlikely(mem_cgroup_stealed(memcg)) || PageTransHuge(page)) {
+ if (unlikely(mem_cgroup_stealed(memcg))) {
/* take a lock against to access pc->mem_cgroup */
move_lock_page_cgroup(pc, &flags);
need_unlock = true;
--
1.7.4.1



\
 
 \ /
  Last update: 2012-01-20 04:29    [W:0.092 / U:0.516 seconds]
©2003-2014 Jasper Spaans. Advertise on this site