net/smc: Optimize the timing of unlocking in smc_listen_work
PATCH 1/1 net/smc: Optimize the timing of unlocking in smc_listen_work
The optimized code is equivalent to the original process, and it releases the lock early.
--- net/smc/af_smc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/smc/af_smc.c +2 -2
@@ -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);
Signature · 1 line
2.43.0
Jakub Kicinski
maintainerQuoted 2 lines · On Sat, 30 Nov 2024 16:26:30 +0800 liqiang wrote:
The optimized code is equivalent to the original process, and it releases the lock early.
By a single clock cycle? You need to provide much more detailed justification, otherwise this looks like churn for no real gain.
Signature · 1 line
pw-bot: cr
Quoted 6 lines · Jakub Kicinski
Quoted 2 lines · On Sat, 30 Nov 2024 16:26:30 +0800 liqiang wrote:
The optimized code is equivalent to the original process, and it releases the lock early.
By a single clock cycle? You need to provide much more detailed justification, otherwise this looks like churn for no real gain.
I don't have any more information about this patch, I saw that the lock will be released regardless of branch true or false, so brought it forward.
Thanks for your reply, Jakub!
:)
Signature · 2 lines
Cheers, Li Qiang