Message ID | 1639571361-101128-1-git-send-email-alibuda@linux.alibaba.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] net/smc: Prevent smc_release() from long blocking | expand |
On 15/12/2021 13:29, D. Wythe wrote: > From: "D. Wythe" <alibuda@linux.alibaba.com> > > In nginx/wrk benchmark, there's a hung problem with high probability > on case likes that: (client will last several minutes to exit) > > server: smc_run nginx > > client: smc_run wrk -c 10000 -t 1 http://server > > Client hangs with the following backtrace: Good finding, thank you! Acked-by: Karsten Graul <kgraul@linux.ibm.com>
On Thu, 16 Dec 2021 11:08:13 +0100 Karsten Graul wrote: > On 15/12/2021 13:29, D. Wythe wrote: > > From: "D. Wythe" <alibuda@linux.alibaba.com> > > > > In nginx/wrk benchmark, there's a hung problem with high probability > > on case likes that: (client will last several minutes to exit) > > > > server: smc_run nginx > > > > client: smc_run wrk -c 10000 -t 1 http://server > > > > Client hangs with the following backtrace: In the future please make sure to leave the commit title in the Fixes tag exactly as is (you seem to have removed a "net/" prefix). > Good finding, thank you! > > Acked-by: Karsten Graul <kgraul@linux.ibm.com> Applied, thanks.
Sorry for this mistake, I'll pay more attention next time. Thanks. On Thu, Dec 16, 2021 at 08:13:31AM -0800, Jakub Kicinski wrote: > On Thu, 16 Dec 2021 11:08:13 +0100 Karsten Graul wrote: > > On 15/12/2021 13:29, D. Wythe wrote: > > > From: "D. Wythe" <alibuda@linux.alibaba.com> > > > > > > In nginx/wrk benchmark, there's a hung problem with high probability > > > on case likes that: (client will last several minutes to exit) > > > > > > server: smc_run nginx > > > > > > client: smc_run wrk -c 10000 -t 1 http://server > > > > > > Client hangs with the following backtrace: > > In the future please make sure to leave the commit title in the Fixes > tag exactly as is (you seem to have removed a "net/" prefix). > > > Good finding, thank you! > > > > Acked-by: Karsten Graul <kgraul@linux.ibm.com> > > Applied, thanks.
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index b44cc4c..5d9911c 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -195,7 +195,9 @@ static int smc_release(struct socket *sock) /* cleanup for a dangling non-blocking connect */ if (smc->connect_nonblock && sk->sk_state == SMC_INIT) tcp_abort(smc->clcsock->sk, ECONNABORTED); - flush_work(&smc->connect_work); + + if (cancel_work_sync(&smc->connect_work)) + sock_put(&smc->sk); /* sock_hold in smc_connect for passive closing */ if (sk->sk_state == SMC_LISTEN) /* smc_close_non_accepted() is called and acquires