Skip to content

Commit

Permalink
memcg: cleanup for_each_node_state()
Browse files Browse the repository at this point in the history
We already have for_each_node(node) define in nodemask.h, better to use it.

Signed-off-by: Bob Liu <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Johannes Weiner <[email protected]>
Acked-by: KAMEZAWA Hiroyuki <[email protected]>
Cc: KOSAKI Motohiro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
aet00 authored and torvalds committed Jan 13, 2012
1 parent 38c5d72 commit 3ed28fa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ static void mem_cgroup_remove_from_trees(struct mem_cgroup *memcg)
struct mem_cgroup_per_zone *mz;
struct mem_cgroup_tree_per_zone *mctz;

for_each_node_state(node, N_POSSIBLE) {
for_each_node(node) {
for (zone = 0; zone < MAX_NR_ZONES; zone++) {
mz = mem_cgroup_zoneinfo(memcg, node, zone);
mctz = soft_limit_tree_node_zone(node, zone);
Expand Down Expand Up @@ -4818,7 +4818,7 @@ static void __mem_cgroup_free(struct mem_cgroup *memcg)
mem_cgroup_remove_from_trees(memcg);
free_css_id(&mem_cgroup_subsys, &memcg->css);

for_each_node_state(node, N_POSSIBLE)
for_each_node(node)
free_mem_cgroup_per_zone_info(memcg, node);

free_percpu(memcg->stat);
Expand Down Expand Up @@ -4877,7 +4877,7 @@ static int mem_cgroup_soft_limit_tree_init(void)
struct mem_cgroup_tree_per_zone *rtpz;
int tmp, node, zone;

for_each_node_state(node, N_POSSIBLE) {
for_each_node(node) {
tmp = node;
if (!node_state(node, N_NORMAL_MEMORY))
tmp = -1;
Expand All @@ -4896,7 +4896,7 @@ static int mem_cgroup_soft_limit_tree_init(void)
return 0;

err_cleanup:
for_each_node_state(node, N_POSSIBLE) {
for_each_node(node) {
if (!soft_limit_tree.rb_tree_per_node[node])
break;
kfree(soft_limit_tree.rb_tree_per_node[node]);
Expand All @@ -4917,7 +4917,7 @@ mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont)
if (!memcg)
return ERR_PTR(error);

for_each_node_state(node, N_POSSIBLE)
for_each_node(node)
if (alloc_mem_cgroup_per_zone_info(memcg, node))
goto free_out;

Expand Down

0 comments on commit 3ed28fa

Please sign in to comment.