From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
Michal Hocko <mhocko@suse.cz>,
"hannes@cmpxchg.org" <hannes@cmpxchg.org>,
Hugh Dickins <hughd@google.com>, Ying Han <yinghan@google.com>
Subject: [PATCH v3] memcg: remove unnecessary thp check at page stat accounting
Date: Fri, 20 Jan 2012 12:25:12 +0900 [thread overview]
Message-ID: <20120120122512.decd06c0.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <20120119161445.b3a8a9d2.kamezawa.hiroyu@jp.fujitsu.com>
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
next prev parent reply other threads:[~2012-01-20 3:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-19 7:14 [PATCH] " KAMEZAWA Hiroyuki
2012-01-19 9:34 ` Michal Hocko
2012-01-20 0:29 ` KAMEZAWA Hiroyuki
2012-01-20 3:25 ` KAMEZAWA Hiroyuki [this message]
2012-01-20 8:43 ` [PATCH v3] " Michal Hocko
2012-01-23 20:11 ` [PATCH] " Ying Han
2012-01-24 8:41 ` Johannes Weiner
2012-01-25 18:54 ` Ying Han
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120120122512.decd06c0.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.cz \
--cc=yinghan@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®