[PATCH v3] nvme-tcp: lockdep: use dynamic lockdep keys per socket instance
Keith Busch
kbusch at kernel.org
Thu Jun 4 01:28:43 PDT 2026
On Thu, Jun 04, 2026 at 11:32:08AM +0900, Shin'ichiro Kawasaki wrote:
> When NVMe-TCP controller setup and teardown are repeated with lockdep
> enabled, lockdep reports false positives WARN for the following locks:
>
> 1) &q->elevator_lock : IO scheduler change context
> 2) &q->q_usage_counter(io) : SCSI disk probe context
> 3) fs_reclaim : CPU hotplug bring-up context
> 4) cpu_hotplug_lock : socket establishment context
> 5) sk_lock-AF_INET-NVME : MQ sched dispatch context for the socket
> 6) set->srcu : NVMe controller delete context
>
> The lockdep WARN was observed by running blktests test case nvme/005 for
> tcp transport on v7.1-rc1 kernel with a patch. Refer to the Link tag for
> the details of the WARN.
>
> This is a false positive because lockdep confuses lock 4) (socket
> establishment) with lock 5) (socket in use) for different socket
> instances. The locks belong to different sockets, but lockdep treats
> them as the same due to shared static lockdep keys.
Thanks, applied to nvme-7.2.
More information about the Linux-nvme
mailing list