Skip to content

Commit 42a9a53

Browse files
Yang Shitorvalds
authored andcommitted
mm: vmscan: protect shrinker idr replace with CONFIG_MEMCG
Since commit 0a432dc ("mm: shrinker: make shrinker not depend on memcg kmem"), shrinkers' idr is protected by CONFIG_MEMCG instead of CONFIG_MEMCG_KMEM, so it makes no sense to protect shrinker idr replace with CONFIG_MEMCG_KMEM. And in the CONFIG_MEMCG && CONFIG_SLOB case, shrinker_idr contains only shrinker, and it is deferred_split_shrinker. But it is never actually called, since idr_replace() is never compiled due to the wrong #ifdef. The deferred_split_shrinker all the time is staying in half-registered state, and it's never called for subordinate mem cgroups. Link: http://lkml.kernel.org/r/[email protected] Fixes: 0a432dc ("mm: shrinker: make shrinker not depend on memcg kmem") Signed-off-by: Yang Shi <[email protected]> Reviewed-by: Kirill Tkhai <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Shakeel Butt <[email protected]> Cc: Roman Gushchin <[email protected]> Cc: <[email protected]> [5.4+] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 253a496 commit 42a9a53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/vmscan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ void register_shrinker_prepared(struct shrinker *shrinker)
387387
{
388388
down_write(&shrinker_rwsem);
389389
list_add_tail(&shrinker->list, &shrinker_list);
390-
#ifdef CONFIG_MEMCG_KMEM
390+
#ifdef CONFIG_MEMCG
391391
if (shrinker->flags & SHRINKER_MEMCG_AWARE)
392392
idr_replace(&shrinker_idr, shrinker, shrinker->id);
393393
#endif

0 commit comments

Comments
 (0)