summaryrefslogtreecommitdiff
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index fbf64e6f64e4..2efec685793b 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4509,24 +4509,23 @@ EXPORT_SYMBOL(parent_mem_cgroup);
static void __init mem_cgroup_soft_limit_tree_init(void)
{
- struct mem_cgroup_tree_per_node *rtpn;
- struct mem_cgroup_tree_per_zone *rtpz;
- int tmp, node, zone;
+ int node;
for_each_node(node) {
- tmp = node;
- if (!node_state(node, N_NORMAL_MEMORY))
- tmp = -1;
- rtpn = kzalloc_node(sizeof(*rtpn), GFP_KERNEL, tmp);
- BUG_ON(!rtpn);
+ struct mem_cgroup_tree_per_node *rtpn;
+ int zone;
- soft_limit_tree.rb_tree_per_node[node] = rtpn;
+ rtpn = kzalloc_node(sizeof(*rtpn), GFP_KERNEL,
+ node_online(node) ? node : NUMA_NO_NODE);
for (zone = 0; zone < MAX_NR_ZONES; zone++) {
+ struct mem_cgroup_tree_per_zone *rtpz;
+
rtpz = &rtpn->rb_tree_per_zone[zone];
rtpz->rb_root = RB_ROOT;
spin_lock_init(&rtpz->lock);
}
+ soft_limit_tree.rb_tree_per_node[node] = rtpn;
}
}