On Mon, 9 Dec 2019, Qian Cai wrote: > It happens to me too with a probably easier to trigger deadlock. Basically, we have, > > memcg_create_kmem_cache(): > cpu_hotplug_lock.rw_sem/mem_hotplug_lock.rw_sem —> kn->count Right. Memcg runs this function at cgroup creation time. sysfs initialization was designed to run a at boot. So the sysfs initialization needs a rewrite of its serialization for the memcg case. We cannot loop over the list of all kmem caches holding the slab_mutex anymore.