[PATCH 1/2] Revert "nvme-tcp: lockdep: use dynamic lockdep keys per socket instance"

Eric Dumazet edumazet at google.com
Mon Sep 14 03:34:54 PDT 2026


On Mon, Sep 14, 2026 at 12:49 AM Shin'ichiro Kawasaki
<shinichiro.kawasaki at opensource.wdc.com> wrote:
>
> From: Shin'ichiro Kawasaki <shinichiro.kawasaki at wdc.com>
>
> This reverts commit 19bdb70c77d3b24239a453291299b64040bdba86.
>
> The commit 19bdb70c77d3 ("nvme-tcp: lockdep: use dynamic lockdep keys
> per socket instance") addressed the lockdep WARN caused by the circular
> lock dependency among six locks:
>
>   set->srcu -> sk_lock -> cpu_hotplug_lock -> fs_reclaim -> q_usage_counter -> elevator_lock -> set->srcu
>
> As its title says, the commit cut the dependency by introducing the
> dynamic lockdep keys per socket instance. However, as described in the
> Link tag URL, the commit made a wrong assumption: it assumed that
> __fput_sync(queue->sock->file) in nvme_tcp_free_queue() would
> synchronously destroy the socket. This is wrong: when in-flight packets
> cause delayed free of the socket, the prematurely freed lockdep key is
> referred to and causes another WARN. The commit is an imperfect fix.
> Hence revert it.
>
> To address the circular dependency among the six locks, another solution
> is required. It is provided by the commit 0ba6912f7e97 ("Revert "once:
> don't use a work queue to reset sleepable static key""). It cuts the
> dependency between sk_lock and cpu_hotplug_lock. This solution is
> simpler, and reduces the complexity in nvme-tcp.
>
> Link: https://lore.kernel.org/lkml/CANn89i+wnTLC==UnXCpjsS4YxvEfhe5oK0N7fttbqr1zKyqdug@mail.gmail.com/
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki at wdc.com>

Reviewed-by: Eric Dumazet <edumazet at google.com>

Thanks!



More information about the Linux-nvme mailing list