The patch titled Subject: mm-iterate-only-over-charged-shrinkers-during-memcg-shrink_slab-v9 has been removed from the -mm tree. Its filename was mm-iterate-only-over-charged-shrinkers-during-memcg-shrink_slab-v9.patch This patch was dropped because it was folded into mm-iterate-only-over-charged-shrinkers-during-memcg-shrink_slab.patch ------------------------------------------------------ From: Kirill Tkhai <ktkhai@xxxxxxxxxxxxx> Subject: mm-iterate-only-over-charged-shrinkers-during-memcg-shrink_slab-v9 Link: http://lkml.kernel.org/r/153112558507.4097.12713813335683345488.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai <ktkhai@xxxxxxxxxxxxx> Acked-by: Vladimir Davydov <vdavydov.dev@xxxxxxxxx> Tested-by: Shakeel Butt <shakeelb@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/vmscan.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) --- a/mm/vmscan.c~mm-iterate-only-over-charged-shrinkers-during-memcg-shrink_slab-v9 +++ a/mm/vmscan.c @@ -364,11 +364,6 @@ int prealloc_shrinker(struct shrinker *s if (!shrinker->nr_deferred) return -ENOMEM; - if (shrinker->flags & SHRINKER_MEMCG_AWARE) { - if (prealloc_memcg_shrinker(shrinker)) - goto free_deferred; - } - /* * There is a window between prealloc_shrinker() * and register_shrinker_prepared(). We don't want @@ -383,6 +378,12 @@ int prealloc_shrinker(struct shrinker *s * is not registered (id is not assigned). */ INIT_LIST_HEAD(&shrinker->list); + + if (shrinker->flags & SHRINKER_MEMCG_AWARE) { + if (prealloc_memcg_shrinker(shrinker)) + goto free_deferred; + } + return 0; free_deferred: @@ -571,13 +572,10 @@ static unsigned long shrink_slab_memcg(g if (!down_read_trylock(&shrinker_rwsem)) return 0; - /* - * 1) Caller passes only alive memcg, so map can't be NULL. - * 2) shrinker_rwsem protects from maps expanding. - */ map = rcu_dereference_protected(memcg->nodeinfo[nid]->shrinker_map, true); - BUG_ON(!map); + if (unlikely(!map)) + goto unlock; for_each_set_bit(i, map->map, shrinker_nr_max) { struct shrink_control sc = { @@ -592,7 +590,6 @@ static unsigned long shrink_slab_memcg(g clear_bit(i, map->map); continue; } - BUG_ON(!(shrinker->flags & SHRINKER_MEMCG_AWARE)); /* See comment in prealloc_shrinker() */ if (unlikely(list_empty(&shrinker->list))) @@ -606,7 +603,7 @@ static unsigned long shrink_slab_memcg(g break; } } - +unlock: up_read(&shrinker_rwsem); return freed; } _ Patches currently in -mm which might be from ktkhai@xxxxxxxxxxxxx are list_lru-combine-code-under-the-same-define.patch mm-introduce-config_memcg_kmem-as-combination-of-config_memcg-config_slob.patch mm-assign-id-to-every-memcg-aware-shrinker.patch memcg-move-up-for_each_mem_cgroup-_tree-defines.patch mm-assign-memcg-aware-shrinkers-bitmap-to-memcg.patch mm-refactoring-in-workingset_init.patch fs-refactoring-in-alloc_super.patch fs-propagate-shrinker-id-to-list_lru.patch list_lru-add-memcg-argument-to-list_lru_from_kmem.patch list_lru-pass-dst_memcg-argument-to-memcg_drain_list_lru_node.patch list_lru-pass-lru-argument-to-memcg_drain_list_lru_node.patch mm-export-mem_cgroup_is_root.patch mm-set-bit-in-memcg-shrinker-bitmap-on-first-list_lru-item-apearance.patch mm-iterate-only-over-charged-shrinkers-during-memcg-shrink_slab.patch mm-add-shrink_empty-shrinker-methods-return-value.patch mm-clear-shrinker-bit-if-there-are-no-objects-related-to-memcg.patch mm-clear-shrinker-bit-if-there-are-no-objects-related-to-memcg-v9.patch mm-move-check-for-shrinker_numa_aware-to-do_shrink_slab.patch mm-use-special-value-shrinker_registering-instead-list_empty-check.patch mm-use-special-value-shrinker_registering-instead-list_empty-check-v3.patch