aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Liu <lliubbo@gmail.com>2012-01-12 20:19:04 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-12 23:13:07 -0500
commit3ed28fa1080c73747ce17f2025b28b062fb5aa7f (patch)
treef4eab7da502fb728fac728220bc1f296ee04dca1
parent38c5d72f3ebe5ddd57d2f08dc035070fc6c9a287 (diff)
memcg: cleanup for_each_node_state()
We already have for_each_node(node) define in nodemask.h, better to use it. Signed-off-by: Bob Liu <lliubbo@gmail.com> Acked-by: Michal Hocko <mhocko@suse.cz> Cc: Johannes Weiner <hannes@cmpxchg.org> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/memcontrol.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index ff051ee8fb4b..609c49f492e6 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -565,7 +565,7 @@ static void mem_cgroup_remove_from_trees(struct mem_cgroup *memcg)
565 struct mem_cgroup_per_zone *mz; 565 struct mem_cgroup_per_zone *mz;
566 struct mem_cgroup_tree_per_zone *mctz; 566 struct mem_cgroup_tree_per_zone *mctz;
567 567
568 for_each_node_state(node, N_POSSIBLE) { 568 for_each_node(node) {
569 for (zone = 0; zone < MAX_NR_ZONES; zone++) { 569 for (zone = 0; zone < MAX_NR_ZONES; zone++) {
570 mz = mem_cgroup_zoneinfo(memcg, node, zone); 570 mz = mem_cgroup_zoneinfo(memcg, node, zone);
571 mctz = soft_limit_tree_node_zone(node, zone); 571 mctz = soft_limit_tree_node_zone(node, zone);
@@ -4818,7 +4818,7 @@ static void __mem_cgroup_free(struct mem_cgroup *memcg)
4818 mem_cgroup_remove_from_trees(memcg); 4818 mem_cgroup_remove_from_trees(memcg);
4819 free_css_id(&mem_cgroup_subsys, &memcg->css); 4819 free_css_id(&mem_cgroup_subsys, &memcg->css);
4820 4820
4821 for_each_node_state(node, N_POSSIBLE) 4821 for_each_node(node)
4822 free_mem_cgroup_per_zone_info(memcg, node); 4822 free_mem_cgroup_per_zone_info(memcg, node);
4823 4823
4824 free_percpu(memcg->stat); 4824 free_percpu(memcg->stat);
@@ -4877,7 +4877,7 @@ static int mem_cgroup_soft_limit_tree_init(void)
4877 struct mem_cgroup_tree_per_zone *rtpz; 4877 struct mem_cgroup_tree_per_zone *rtpz;
4878 int tmp, node, zone; 4878 int tmp, node, zone;
4879 4879
4880 for_each_node_state(node, N_POSSIBLE) { 4880 for_each_node(node) {
4881 tmp = node; 4881 tmp = node;
4882 if (!node_state(node, N_NORMAL_MEMORY)) 4882 if (!node_state(node, N_NORMAL_MEMORY))
4883 tmp = -1; 4883 tmp = -1;
@@ -4896,7 +4896,7 @@ static int mem_cgroup_soft_limit_tree_init(void)
4896 return 0; 4896 return 0;
4897 4897
4898err_cleanup: 4898err_cleanup:
4899 for_each_node_state(node, N_POSSIBLE) { 4899 for_each_node(node) {
4900 if (!soft_limit_tree.rb_tree_per_node[node]) 4900 if (!soft_limit_tree.rb_tree_per_node[node])
4901 break; 4901 break;
4902 kfree(soft_limit_tree.rb_tree_per_node[node]); 4902 kfree(soft_limit_tree.rb_tree_per_node[node]);
@@ -4917,7 +4917,7 @@ mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont)
4917 if (!memcg) 4917 if (!memcg)
4918 return ERR_PTR(error); 4918 return ERR_PTR(error);
4919 4919
4920 for_each_node_state(node, N_POSSIBLE) 4920 for_each_node(node)
4921 if (alloc_mem_cgroup_per_zone_info(memcg, node)) 4921 if (alloc_mem_cgroup_per_zone_info(memcg, node))
4922 goto free_out; 4922 goto free_out;
4923 4923