diff options
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -3708,8 +3708,7 @@ static int do_tune_cpucache(struct kmem_cache *cachep, int limit, | |||
3708 | int batchcount, int shared, gfp_t gfp) | 3708 | int batchcount, int shared, gfp_t gfp) |
3709 | { | 3709 | { |
3710 | int ret; | 3710 | int ret; |
3711 | struct kmem_cache *c = NULL; | 3711 | struct kmem_cache *c; |
3712 | int i = 0; | ||
3713 | 3712 | ||
3714 | ret = __do_tune_cpucache(cachep, limit, batchcount, shared, gfp); | 3713 | ret = __do_tune_cpucache(cachep, limit, batchcount, shared, gfp); |
3715 | 3714 | ||
@@ -3719,12 +3718,10 @@ static int do_tune_cpucache(struct kmem_cache *cachep, int limit, | |||
3719 | if ((ret < 0) || !is_root_cache(cachep)) | 3718 | if ((ret < 0) || !is_root_cache(cachep)) |
3720 | return ret; | 3719 | return ret; |
3721 | 3720 | ||
3722 | VM_BUG_ON(!mutex_is_locked(&slab_mutex)); | 3721 | lockdep_assert_held(&slab_mutex); |
3723 | for_each_memcg_cache_index(i) { | 3722 | for_each_memcg_cache(c, cachep) { |
3724 | c = cache_from_memcg_idx(cachep, i); | 3723 | /* return value determined by the root cache only */ |
3725 | if (c) | 3724 | __do_tune_cpucache(c, limit, batchcount, shared, gfp); |
3726 | /* return value determined by the parent cache only */ | ||
3727 | __do_tune_cpucache(c, limit, batchcount, shared, gfp); | ||
3728 | } | 3725 | } |
3729 | 3726 | ||
3730 | return ret; | 3727 | return ret; |