From: liqiang <liqiang64@huawei.com>
To: <wenjia@linux.ibm.com>, <jaka@linux.ibm.com>,
<alibuda@linux.alibaba.com>, <tonylu@linux.alibaba.com>,
<guwen@linux.alibaba.com>
Cc: <linux-s390@vger.kernel.org>, <netdev@vger.kernel.org>,
<luanjianhai@huawei.com>, <zhangxuzhou4@huawei.com>,
<dengguangxing@huawei.com>, <gaochao24@huawei.com>,
<liqiang64@huawei.com>
Subject: [PATCH net-next] net/smc: Optimize the timing of unlocking in smc_listen_work
Date: Sat, 30 Nov 2024 16:26:30 +0800 [thread overview]
Message-ID: <20241130082630.2007-1-liqiang64@huawei.com> (raw)
The optimized code is equivalent to the original process, and it releases the
lock early.
Signed-off-by: liqiang <liqiang64@huawei.com>
---
net/smc/af_smc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 9d76e902fd77..7fa80be1ea93 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -2526,9 +2526,9 @@ static void smc_listen_work(struct work_struct *work)
if (!ini->is_smcd) {
rc = smc_listen_rdma_finish(new_smc, cclc,
ini->first_contact_local, ini);
- if (rc)
- goto out_unlock;
mutex_unlock(&smc_server_lgr_pending);
+ if (rc)
+ goto out_decl;
}
smc_conn_save_peer_info(new_smc, cclc);
--
2.43.0
next reply other threads:[~2024-11-30 8:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-30 8:26 liqiang [this message]
2024-11-30 19:04 ` [PATCH net-next] net/smc: Optimize the timing of unlocking in smc_listen_work Jakub Kicinski
2024-12-02 2:20 ` Li Qiang
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=20241130082630.2007-1-liqiang64@huawei.com \
--to=liqiang64@huawei.com \
--cc=alibuda@linux.alibaba.com \
--cc=dengguangxing@huawei.com \
--cc=gaochao24@huawei.com \
--cc=guwen@linux.alibaba.com \
--cc=jaka@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=luanjianhai@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=tonylu@linux.alibaba.com \
--cc=wenjia@linux.ibm.com \
--cc=zhangxuzhou4@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