Skip to content

Commit

Permalink
net/smc: Add comment for smc_tx_pending
Browse files Browse the repository at this point in the history
The previous patch introduces a lock-free version of smc_tx_work() to
solve unnecessary lock contention, which is expected to be held lock.
So this adds comment to remind people to keep an eye out for locks.

Suggested-by: Stefan Raspl <[email protected]>
Signed-off-by: Tony Lu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Tony Lu authored and davem330 committed Feb 14, 2022
1 parent 806c37d commit 2e13bde
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/smc/smc_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,10 @@ int smc_tx_sndbuf_nonempty(struct smc_connection *conn)
return rc;
}

/* Wakeup sndbuf consumers from process context
* since there is more data to transmit. The caller
* must hold sock lock.
*/
void smc_tx_pending(struct smc_connection *conn)
{
struct smc_sock *smc = container_of(conn, struct smc_sock, conn);
Expand All @@ -626,7 +630,8 @@ void smc_tx_pending(struct smc_connection *conn)
}

/* Wakeup sndbuf consumers from process context
* since there is more data to transmit
* since there is more data to transmit in locked
* sock.
*/
void smc_tx_work(struct work_struct *work)
{
Expand Down

0 comments on commit 2e13bde

Please sign in to comment.