RDS: only put sockets that have seen congestion on the poll_waitq
[deliverable/linux.git] / net / rds / af_rds.c
index 853c52be781f7992a850ef2229b6c61b6a3e6f74..937ecda4abe7e4956523c6ac66b458b321d966a7 100644 (file)
@@ -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;
 }
 
This page took 0.027074 seconds and 5 git commands to generate.