On Fri, Dec 6, 2024 at 4:06 PM Ming Lei <ming.lei@xxxxxxxxxx> wrote: > > Registering and unregistering cpuhp requires global cpu hotplug lock, > which is used everywhere. Meantime q->sysfs_lock is used in block layer > almost everywhere. > > It is easy to trigger lockdep warning[1] by connecting the two locks. > > Fix the warning by moving blk-mq's cpuhp callback registering out of > q->sysfs_lock. Add one dedicated global lock for covering registering & > unregistering hctx's cpuhp, and it is safe to do so because hctx is > guaranteed to be live if our request_queue is live. > > [1] https://lore.kernel.org/lkml/Z04pz3AlvI4o0Mr8@agluck-desk3/ > > Cc: Reinette Chatre <reinette.chatre@xxxxxxxxx> > Cc: Fenghua Yu <fenghua.yu@xxxxxxxxx> > Cc: Peter Newman <peternewman@xxxxxxxxxx> > Cc: Babu Moger <babu.moger@xxxxxxx> > Reported-by: Luck Tony <tony.luck@xxxxxxxxx> > Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx> Please ignore this one which depends on another patch, and will resend V2, and sorry for the noise.