Commit 33f3fcc2 authored by Karsten Graul's avatar Karsten Graul Committed by David S. Miller

net/smc: do not wait under send_lock

smc_cdc_get_free_slot() might wait for free transfer buffers when using
SMC-R. This wait should not be done under the send_lock, which is a
spin_lock. This fixes a cpu loop in parallel threads waiting for the
send_lock.
Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
Signed-off-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 51c5aba3
...@@ -488,25 +488,23 @@ static int smcr_tx_sndbuf_nonempty(struct smc_connection *conn) ...@@ -488,25 +488,23 @@ static int smcr_tx_sndbuf_nonempty(struct smc_connection *conn)
struct smc_wr_buf *wr_buf; struct smc_wr_buf *wr_buf;
int rc; int rc;
spin_lock_bh(&conn->send_lock);
rc = smc_cdc_get_free_slot(conn, &wr_buf, &pend); rc = smc_cdc_get_free_slot(conn, &wr_buf, &pend);
if (rc < 0) { if (rc < 0) {
if (rc == -EBUSY) { if (rc == -EBUSY) {
struct smc_sock *smc = struct smc_sock *smc =
container_of(conn, struct smc_sock, conn); container_of(conn, struct smc_sock, conn);
if (smc->sk.sk_err == ECONNABORTED) { if (smc->sk.sk_err == ECONNABORTED)
rc = sock_error(&smc->sk); return sock_error(&smc->sk);
goto out_unlock;
}
rc = 0; rc = 0;
if (conn->alert_token_local) /* connection healthy */ if (conn->alert_token_local) /* connection healthy */
mod_delayed_work(system_wq, &conn->tx_work, mod_delayed_work(system_wq, &conn->tx_work,
SMC_TX_WORK_DELAY); SMC_TX_WORK_DELAY);
} }
goto out_unlock; return rc;
} }
spin_lock_bh(&conn->send_lock);
if (!conn->local_tx_ctrl.prod_flags.urg_data_present) { if (!conn->local_tx_ctrl.prod_flags.urg_data_present) {
rc = smc_tx_rdma_writes(conn); rc = smc_tx_rdma_writes(conn);
if (rc) { if (rc) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment