Skip to content

Commit 3e6b11d

Browse files
avagintorvalds
authored andcommitted
memcg: don't initialize kmem-cache destroying work for root caches
struct memcg_cache_params has a union. Different parts of this union are used for root and non-root caches. A part with destroying work is used only for non-root caches. I fixed the same problem in another place v3.9-rc1-16204-gf101a94, but didn't notice this one. This patch fixes the kernel panic: [ 46.848187] BUG: unable to handle kernel paging request at 000000fffffffeb8 [ 46.849026] IP: [<ffffffff811a484c>] kmem_cache_destroy_memcg_children+0x6c/0xc0 [ 46.849092] PGD 0 [ 46.849092] Oops: 0000 [#1] SMP ... Signed-off-by: Andrey Vagin <[email protected]> Cc: Glauber Costa <[email protected]> Cc: Johannes Weiner <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Balbir Singh <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Cc: Konstantin Khlebnikov <[email protected]> Cc: <[email protected]> [3.9.x] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 584d88b commit 3e6b11d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/memcontrol.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3195,11 +3195,11 @@ int memcg_register_cache(struct mem_cgroup *memcg, struct kmem_cache *s,
31953195
if (!s->memcg_params)
31963196
return -ENOMEM;
31973197

3198-
INIT_WORK(&s->memcg_params->destroy,
3199-
kmem_cache_destroy_work_func);
32003198
if (memcg) {
32013199
s->memcg_params->memcg = memcg;
32023200
s->memcg_params->root_cache = root_cache;
3201+
INIT_WORK(&s->memcg_params->destroy,
3202+
kmem_cache_destroy_work_func);
32033203
} else
32043204
s->memcg_params->is_root_cache = true;
32053205

0 commit comments

Comments
 (0)