RDS: make sure not to loop forever inside rds_send_xmit
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Wed, 8 Apr 2015 16:33:47 +0000 (12:33 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Apr 2015 19:17:32 +0000 (15:17 -0400)
If a determined set of concurrent senders keep the send queue full,
we can loop forever inside rds_send_xmit.  This fix has two parts.

First we are dropping out of the while(1) loop after we've processed a
large batch of messages.

Second we add a generation number that gets bumped each time the
xmit bit lock is acquired.  If someone else has jumped in and
made progress in the queue, we skip our goto restart.

Original patch by Chris Mason.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

No differences found