diff options
author | Andy Grover <andy.grover@oracle.com> | 2010-03-11 14:50:04 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-17 05:16:59 +0100 |
commit | b98ba52f96e7cdb4dbe2b06bced83d95d94c9d02 (patch) | |
tree | 72e22772c6326ff554bd030bda35abcb1526249e /net/rds/af_rds.c | |
parent | RDS: Fix locking in rds_send_drop_to() (diff) | |
download | linux-b98ba52f96e7cdb4dbe2b06bced83d95d94c9d02.tar.xz linux-b98ba52f96e7cdb4dbe2b06bced83d95d94c9d02.zip |
RDS: only put sockets that have seen congestion on the poll_waitq
rds_poll_waitq's listeners will be awoken if we receive a congestion
notification. Bad performance may result because *all* polled sockets
contend for this single lock. However, it should not be necessary to
wake pollers when a congestion update arrives if they have never
experienced congestion, and not putting these on the waitq will
hopefully greatly reduce contention.
Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/af_rds.c')
-rw-r--r-- | net/rds/af_rds.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c index 853c52be781f..937ecda4abe7 100644 --- a/net/rds/af_rds.c +++ b/net/rds/af_rds.c @@ -159,7 +159,8 @@ static unsigned int rds_poll(struct file *file, struct socket *sock, poll_wait(file, sk->sk_sleep, wait); - poll_wait(file, &rds_poll_waitq, wait); + if (rs->rs_seen_congestion) + poll_wait(file, &rds_poll_waitq, wait); read_lock_irqsave(&rs->rs_recv_lock, flags); if (!rs->rs_cong_monitor) { @@ -181,6 +182,10 @@ static unsigned int rds_poll(struct file *file, struct socket *sock, mask |= (POLLOUT | POLLWRNORM); read_unlock_irqrestore(&rs->rs_recv_lock, flags); + /* clear state any time we wake a seen-congested socket */ + if (mask) + rs->rs_seen_congestion = 0; + return mask; } |