Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356609
b: refs/heads/master
c: e477749
h: refs/heads/master
i:
  356607: 818a787
v: v3
  • Loading branch information
Michal Hocko authored and Linus Torvalds committed Feb 24, 2013
1 parent 85f3d2e commit 3641825
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 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: 8787a1df30c7b75521fe8cbed42895d47e6b8d52
refs/heads/master: e477749624fcf0dc95bfa494b7fa6ba2000fe670
20 changes: 12 additions & 8 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -2296,6 +2296,17 @@ static void drain_local_stock(struct work_struct *dummy)
clear_bit(FLUSHING_CACHED_CHARGE, &stock->flags);
}

static void __init memcg_stock_init(void)
{
int cpu;

for_each_possible_cpu(cpu) {
struct memcg_stock_pcp *stock =
&per_cpu(memcg_stock, cpu);
INIT_WORK(&stock->work, drain_local_stock);
}
}

/*
* Cache charges(val) which is from res_counter, to local per_cpu area.
* This will be consumed by consume_stock() function, later.
Expand Down Expand Up @@ -6092,15 +6103,7 @@ mem_cgroup_css_alloc(struct cgroup *cont)

/* root ? */
if (cont->parent == NULL) {
int cpu;

root_mem_cgroup = memcg;
for_each_possible_cpu(cpu) {
struct memcg_stock_pcp *stock =
&per_cpu(memcg_stock, cpu);
INIT_WORK(&stock->work, drain_local_stock);
}

res_counter_init(&memcg->res, NULL);
res_counter_init(&memcg->memsw, NULL);
res_counter_init(&memcg->kmem, NULL);
Expand Down Expand Up @@ -6837,6 +6840,7 @@ static int __init mem_cgroup_init(void)
hotcpu_notifier(memcg_cpu_hotplug_callback, 0);
enable_swap_cgroup();
mem_cgroup_soft_limit_tree_init();
memcg_stock_init();
return 0;
}
subsys_initcall(mem_cgroup_init);

0 comments on commit 3641825

Please sign in to comment.