Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356608
b: refs/heads/master
c: 8787a1d
h: refs/heads/master
v: v3
  • Loading branch information
Michal Hocko authored and Linus Torvalds committed Feb 24, 2013
1 parent 818a787 commit 85f3d2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0e50ce3b50fb4ffc38c98fe7622361da4d0808c1
refs/heads/master: 8787a1df30c7b75521fe8cbed42895d47e6b8d52
19 changes: 3 additions & 16 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -6052,7 +6052,7 @@ struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg)
}
EXPORT_SYMBOL(parent_mem_cgroup);

static int mem_cgroup_soft_limit_tree_init(void)
static void __init mem_cgroup_soft_limit_tree_init(void)
{
struct mem_cgroup_tree_per_node *rtpn;
struct mem_cgroup_tree_per_zone *rtpz;
Expand All @@ -6063,8 +6063,7 @@ static int mem_cgroup_soft_limit_tree_init(void)
if (!node_state(node, N_NORMAL_MEMORY))
tmp = -1;
rtpn = kzalloc_node(sizeof(*rtpn), GFP_KERNEL, tmp);
if (!rtpn)
goto err_cleanup;
BUG_ON(!rtpn);

soft_limit_tree.rb_tree_per_node[node] = rtpn;

Expand All @@ -6074,17 +6073,6 @@ static int mem_cgroup_soft_limit_tree_init(void)
spin_lock_init(&rtpz->lock);
}
}
return 0;

err_cleanup:
for_each_node(node) {
if (!soft_limit_tree.rb_tree_per_node[node])
break;
kfree(soft_limit_tree.rb_tree_per_node[node]);
soft_limit_tree.rb_tree_per_node[node] = NULL;
}
return 1;

}

static struct cgroup_subsys_state * __ref
Expand All @@ -6106,8 +6094,6 @@ mem_cgroup_css_alloc(struct cgroup *cont)
if (cont->parent == NULL) {
int cpu;

if (mem_cgroup_soft_limit_tree_init())
goto free_out;
root_mem_cgroup = memcg;
for_each_possible_cpu(cpu) {
struct memcg_stock_pcp *stock =
Expand Down Expand Up @@ -6850,6 +6836,7 @@ static int __init mem_cgroup_init(void)
{
hotcpu_notifier(memcg_cpu_hotplug_callback, 0);
enable_swap_cgroup();
mem_cgroup_soft_limit_tree_init();
return 0;
}
subsys_initcall(mem_cgroup_init);

0 comments on commit 85f3d2e

Please sign in to comment.