From: Mahanta Jambigi <mjambigi@linux.ibm.com>
To: Runyu Xiao <runyu.xiao@seu.edu.cn>,
"D. Wythe" <alibuda@linux.alibaba.com>,
Dust Li <dust.li@linux.alibaba.com>,
Sidraya Jayagond <sidraya@linux.ibm.com>,
Wenjia Zhang <wenjia@linux.ibm.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Tony Lu <tonylu@linux.alibaba.com>,
Wen Gu <guwen@linux.alibaba.com>, Simon Horman <horms@kernel.org>,
Karsten Graul <kgraul@linux.ibm.com>,
linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
jianhao.xu@seu.edu.cn
Subject: Re: [PATCH net] net/smc: avoid recursive sk_callback_lock in listen data_ready
Date: Fri, 19 Jun 2026 11:06:17 +0530 [thread overview]
Message-ID: <5f0b47ee-547e-4ba6-8032-2adb0686d019@linux.ibm.com> (raw)
In-Reply-To: <20260618141629.2904071-1-runyu.xiao@seu.edu.cn>
On 18/06/26 7:46 pm, Runyu Xiao wrote:
> Hi,
>
> Thanks for taking a look.
>
> The exact Lockdep stack I have is from the grounded reproducer, not from
> a production SMC setup. The reproducer keeps the same callback shape:
> the close/flush side holds sk_callback_lock and invokes the installed
> sk_data_ready callback, which re-enters smc_clcsock_data_ready() and tries
> to take sk_callback_lock again.
>
> The relevant Lockdep report is:
>
> WARNING: possible recursive locking detected
> kworker/u4:3/39 is trying to acquire lock:
> (sk_callback_lock) at smc_clcsock_data_ready+0xa/0x4d
>
> but task is already holding lock:
> (sk_callback_lock) at smc_close_flush_work+0xc/0x30
>
> Possible unsafe locking scenario:
>
> CPU0
> ----
> lock(sk_callback_lock);
> lock(sk_callback_lock);
>
> *** DEADLOCK ***
>
> Workqueue: smc_close_wq smc_close_flush_work
>
> Call Trace:
> dump_stack_lvl
> __lock_acquire
> lock_acquire
> _raw_read_lock_bh
> smc_clcsock_data_ready+0xa/0x4d
> smc_close_flush_work+0x1f/0x30
> process_one_work
> worker_thread
> kthread
> ret_from_fork
Thank you for addressing the feedback. My suggestion would be to reply
to the original email thread where the review comments were given, so
that the maintainers can follow the conversation.
https://www.kernel.org/doc/html/latest/process/submitting-patches.html#respond-to-review-comments
Please include above call stack in your next version.
>
> The nvmet change I referred to is:
>
> 2fa8961d3a6a ("nvmet-tcp: fixup hang in nvmet_tcp_listen_data_ready()")
Please include this info in your next version.
>
> The stable/backport patch I originally used as the reference is:
>
> 1c90f930e7b4 ("nvmet-tcp: fixup hang in nvmet_tcp_listen_data_ready()")
>
> Its commit message says that when the socket is closed while in
> TCP_LISTEN, the flush callback can call nvmet_tcp_listen_data_ready()
> with sk_callback_lock already held, so nvmet moved the TCP_LISTEN check
> before taking sk_callback_lock.
>
> For the TCP_LISTEN check: my reasoning was that smc_clcsock_data_ready()
> is installed by smc_listen() on the underlying TCP listen socket and only
> queues smc_tcp_listen_work() for the SMC listen/accept path. Once that
> underlying socket is no longer in TCP_LISTEN, there should be no SMC
> listen accept work to queue from this callback. TCP_SYN_RECV and
> TCP_ESTABLISHED are not listen-socket states for this callback path, so I
> did not intend the callback to queue listen work for those states.
I understand. Please include this info in your next version.
>
> That said, if SMC expects smc_clcsock_data_ready() to handle a non-LISTEN
> state during fallback or another transition, then the proposed check is
> too strict and I should rework the fix.
>
> Thanks,
> Runyu
next prev parent reply other threads:[~2026-06-19 5:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-17 15:28 [PATCH net] net/smc: avoid recursive sk_callback_lock in listen data_ready Runyu Xiao
2026-06-18 6:24 ` Mahanta Jambigi
2026-06-18 14:16 ` Runyu Xiao
2026-06-19 5:36 ` Mahanta Jambigi [this message]
2026-06-19 5:48 ` [PATCH net v2] " Runyu Xiao
2026-06-19 6:35 ` [PATCH net] " Dust Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5f0b47ee-547e-4ba6-8032-2adb0686d019@linux.ibm.com \
--to=mjambigi@linux.ibm.com \
--cc=alibuda@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=dust.li@linux.alibaba.com \
--cc=edumazet@google.com \
--cc=guwen@linux.alibaba.com \
--cc=horms@kernel.org \
--cc=jianhao.xu@seu.edu.cn \
--cc=kgraul@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=runyu.xiao@seu.edu.cn \
--cc=sidraya@linux.ibm.com \
--cc=tonylu@linux.alibaba.com \
--cc=wenjia@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox