Re: lockdep warns: cpu_hotplug_lock.rw_sem --> slab_mutex --> kn->count#39

From: Christopher Lameter
Date: Tue Dec 10 2019 - 13:32:40 EST


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.