From: Wenjia Zhang <wenjia@linux.ibm.com>
To: Zhengchao Shao <shaozhengchao@huawei.com>,
linux-s390@vger.kernel.org, netdev@vger.kernel.org,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com
Cc: jaka@linux.ibm.com, alibuda@linux.alibaba.com,
tonylu@linux.alibaba.com, guwen@linux.alibaba.com,
weiyongjun1@huawei.com, yuehaibing@huawei.com,
tangchengchang@huawei.com
Subject: Re: [PATCH net] net/smc: fix potential sleeping issue in smc_switch_conns
Date: Mon, 15 Apr 2024 19:37:06 +0200 [thread overview]
Message-ID: <f664c557-7924-4a75-a782-040cfc23f404@linux.ibm.com> (raw)
In-Reply-To: <20240413035150.3338977-1-shaozhengchao@huawei.com>
On 13.04.24 05:51, Zhengchao Shao wrote:
> Potential sleeping issue exists in the following processes:
> smc_switch_conns
> spin_lock_bh(&conn->send_lock)
> smc_switch_link_and_count
> smcr_link_put
> __smcr_link_clear
> smc_lgr_put
> __smc_lgr_free
> smc_lgr_free_bufs
> __smc_lgr_free_bufs
> smc_buf_free
> smcr_buf_free
> smcr_buf_unmap_link
> smc_ib_put_memory_region
> ib_dereg_mr
> ib_dereg_mr_user
> mr->device->ops.dereg_mr
> If scheduling exists when the IB driver implements .dereg_mr hook
> function, the bug "scheduling while atomic" will occur. For example,
> cxgb4 and efa driver. Use mutex lock instead of spin lock to fix it.
>
> Fixes: 20c9398d3309 ("net/smc: Resolve the race between SMC-R link access and clear")
> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
> ---
> net/smc/af_smc.c | 2 +-
> net/smc/smc.h | 2 +-
> net/smc/smc_cdc.c | 14 +++++++-------
> net/smc/smc_core.c | 8 ++++----
> net/smc/smc_tx.c | 8 ++++----
> 5 files changed, 17 insertions(+), 17 deletions(-)
>
Hi Zhengchao,
If I understand correctly, the sleeping issue is not the core issue, it
looks like a kind of deadlock or kernel pointer dereference issue. Did
you get crash? Do you have any backtrace? Why do you think the mutex
lock will fix it?
Thanks,
Wenjia
next prev parent reply other threads:[~2024-04-15 17:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-13 3:51 [PATCH net] net/smc: fix potential sleeping issue in smc_switch_conns Zhengchao Shao
2024-04-15 17:37 ` Wenjia Zhang [this message]
2024-04-16 12:06 ` Paolo Abeni
2024-04-17 7:32 ` Guangguan Wang
2024-04-17 15:17 ` Wenjia Zhang
2024-04-17 8:00 ` Guangguan Wang
2024-04-17 8:29 ` shaozhengchao
2024-04-17 15:23 ` Wenjia Zhang
2024-04-18 1:48 ` shaozhengchao
2024-04-18 7:50 ` Wenjia Zhang
2024-04-18 11:01 ` shaozhengchao
2024-04-18 11:57 ` Wenjia Zhang
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=f664c557-7924-4a75-a782-040cfc23f404@linux.ibm.com \
--to=wenjia@linux.ibm.com \
--cc=alibuda@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=guwen@linux.alibaba.com \
--cc=jaka@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shaozhengchao@huawei.com \
--cc=tangchengchang@huawei.com \
--cc=tonylu@linux.alibaba.com \
--cc=weiyongjun1@huawei.com \
--cc=yuehaibing@huawei.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;
as well as URLs for NNTP newsgroup(s).