Skip to content

Commit

Permalink
RDS/TCP: Wait to wake thread when write space available
Browse files Browse the repository at this point in the history
Instead of waking the send thread whenever any send space is available,
wait until it is at least half empty. This is modeled on how
sock_def_write_space() does it, and may help to minimize context
switches.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andy Grover authored and David S. Miller committed Mar 17, 2010
1 parent b075cfd commit 8e82376
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/rds/tcp_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ void rds_tcp_write_space(struct sock *sk)
tc->t_last_seen_una = rds_tcp_snd_una(tc);
rds_send_drop_acked(conn, rds_tcp_snd_una(tc), rds_tcp_is_acked);

queue_delayed_work(rds_wq, &conn->c_send_w, 0);
if ((atomic_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf)
queue_delayed_work(rds_wq, &conn->c_send_w, 0);

out:
read_unlock(&sk->sk_callback_lock);

Expand Down

0 comments on commit 8e82376

Please sign in to comment.