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>,
"cgroups@vger.kernel.org" <cgroups@vger.kernel.org>,
Michal Hocko <mhocko@suse.cz>,
Johannes Weiner <hannes@cmpxchg.org>, Tejun Heo <tj@kernel.org>,
Glauber Costa <glommer@parallels.com>,
Hugh Dickins <hughd@google.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 7/7] memcg: remove drain_all_stock_sync.
Date: Thu, 12 Apr 2012 20:31:36 +0900 [thread overview]
Message-ID: <4F86BD18.4010505@jp.fujitsu.com> (raw)
In-Reply-To: <4F86B9BE.8000105@jp.fujitsu.com>
Because a function moving pages to ancestor works asynchronously now,
drain_all_stock_sync() is unnecessary.
Signed-off-by: KAMEAZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
mm/memcontrol.c | 22 ++--------------------
1 files changed, 2 insertions(+), 20 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index e466809..d42811b 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2053,7 +2053,7 @@ static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages)
* of the hierarchy under it. sync flag says whether we should block
* until the work is done.
*/
-static void drain_all_stock(struct mem_cgroup *root_memcg, bool sync)
+static void drain_all_stock(struct mem_cgroup *root_memcg)
{
int cpu, curcpu;
@@ -2077,16 +2077,6 @@ static void drain_all_stock(struct mem_cgroup *root_memcg, bool sync)
}
}
put_cpu();
-
- if (!sync)
- goto out;
-
- for_each_online_cpu(cpu) {
- struct memcg_stock_pcp *stock = &per_cpu(memcg_stock, cpu);
- if (test_bit(FLUSHING_CACHED_CHARGE, &stock->flags))
- flush_work(&stock->work);
- }
-out:
put_online_cpus();
}
@@ -2103,15 +2093,7 @@ static void drain_all_stock_async(struct mem_cgroup *root_memcg)
*/
if (!mutex_trylock(&percpu_charge_mutex))
return;
- drain_all_stock(root_memcg, false);
- mutex_unlock(&percpu_charge_mutex);
-}
-
-static void drain_all_stock_sync(struct mem_cgroup *root_memcg)
-{
- /* called when force_empty is called */
- mutex_lock(&percpu_charge_mutex);
- drain_all_stock(root_memcg, true);
+ drain_all_stock(root_memcg);
mutex_unlock(&percpu_charge_mutex);
}
--
1.7.4.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2012-04-12 11:33 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-12 11:17 [PATCH v1 0/7] memcg remove pre_destroy KAMEZAWA Hiroyuki
2012-04-12 11:20 ` [PATCH 1/7] res_counter: add a function res_counter_move_parent() KAMEZAWA Hiroyuki
2012-04-12 13:22 ` Glauber Costa
2012-04-12 14:30 ` Frederic Weisbecker
2012-04-13 0:57 ` KAMEZAWA Hiroyuki
2012-04-13 1:04 ` Frederic Weisbecker
2012-04-13 1:05 ` KAMEZAWA Hiroyuki
2012-04-16 22:19 ` Tejun Heo
2012-04-18 6:59 ` KAMEZAWA Hiroyuki
2012-04-16 22:31 ` Tejun Heo
2012-04-18 7:04 ` KAMEZAWA Hiroyuki
2012-04-18 17:03 ` Tejun Heo
2012-04-12 11:21 ` [PATCH 2/7] memcg: move charge to parent only when necessary KAMEZAWA Hiroyuki
2012-04-16 22:21 ` Tejun Heo
2012-04-18 7:01 ` KAMEZAWA Hiroyuki
2012-04-12 11:22 ` [PATCH 3/7] memcg: move charges to root at rmdir() KAMEZAWA Hiroyuki
2012-04-16 22:30 ` Tejun Heo
2012-04-18 7:02 ` KAMEZAWA Hiroyuki
2012-04-12 11:24 ` [PATCH 4/7] memcg: remove 'uncharge' argument from mem_cgroup_move_account() KAMEZAWA Hiroyuki
2012-04-12 13:27 ` Glauber Costa
2012-04-13 1:01 ` KAMEZAWA Hiroyuki
2012-04-12 11:28 ` [PATCH 5/7] memcg: divide force_empty into 2 functions, avoid memory reclaim at rmdir KAMEZAWA Hiroyuki
2012-04-12 13:33 ` Glauber Costa
2012-04-17 17:29 ` Ying Han
2012-04-18 7:14 ` KAMEZAWA Hiroyuki
2012-04-12 11:30 ` [PATCH 6/7] memcg: remove pre_destroy() KAMEZAWA Hiroyuki
2012-04-16 22:38 ` Tejun Heo
2012-04-18 7:12 ` KAMEZAWA Hiroyuki
2012-04-17 17:47 ` Ying Han
2012-04-12 11:31 ` KAMEZAWA Hiroyuki [this message]
2012-04-12 13:35 ` [PATCH 7/7] memcg: remove drain_all_stock_sync Glauber Costa
2012-04-12 13:20 ` [PATCH v1 0/7] memcg remove pre_destroy Glauber Costa
2012-04-12 16:06 ` Tejun Heo
2012-04-12 18:57 ` Aneesh Kumar K.V
2012-04-12 23:59 ` KAMEZAWA Hiroyuki
2012-04-13 8:50 ` Michal Hocko
2012-04-13 22:19 ` Aneesh Kumar K.V
2012-04-16 22:41 ` Tejun Heo
2012-04-17 17:35 ` Ying Han
2012-04-18 7:15 ` KAMEZAWA Hiroyuki
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=4F86BD18.4010505@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=glommer@parallels.com \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.cz \
--cc=tj@kernel.org \
/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