diff mbox

BUG: soft lockup - CPU#6 stuck for 22s! [httpd2-event:15597]

Message ID 1345886085.19483.141.camel@edumazet-glaptop
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Eric Dumazet Aug. 25, 2012, 9:14 a.m. UTC
From: Eric Dumazet <edumazet@google.com>

On Sat, 2012-08-25 at 10:59 +0200, Eric Dumazet wrote:
> On Fri, 2012-08-24 at 20:50 -0400, Cristian Rodríguez wrote:
> > Hi, the issue I reported with IPV6 few weeks ago seems to be gone, but
> > now I am getting the following crash..

> Oh, I now see the bug, I'll send a patch asap

Please try the following fix.

Thanks !

[PATCH] tcp: tcp_slow_start() should not decrease snd_cwnd

Cristian Rodríguez reported various lockups in TCP stack,
introduced by commit 9dc274151a548 (tcp: fix ABC in tcp_slow_start())

We could exit tcp_slow_start() with a zeroed snd_cwnd,
and next time we enter tcp_slow_start(), we run an infinite loop.

Reported-by: Cristian Rodríguez <crrodriguez@opensuse.org>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv4/tcp_cong.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c
index 1432cdb..f20a761 100644
--- a/net/ipv4/tcp_cong.c
+++ b/net/ipv4/tcp_cong.c
@@ -309,6 +309,7 @@  void tcp_slow_start(struct tcp_sock *tp)
 {
 	int cnt; /* increase in packets */
 	unsigned int delta = 0;
+	u32 new_snd_cwnd;
 
 	/* RFC3465: ABC Slow start
 	 * Increase only after a full MSS of bytes is acked
@@ -337,7 +338,8 @@  void tcp_slow_start(struct tcp_sock *tp)
 		tp->snd_cwnd_cnt -= tp->snd_cwnd;
 		delta++;
 	}
-	tp->snd_cwnd = min(tp->snd_cwnd + delta, tp->snd_cwnd_clamp);
+	new_snd_cwnd = min(tp->snd_cwnd + delta, tp->snd_cwnd_clamp);
+	tp->snd_cwnd = max(tp->snd_cwnd, new_snd_cwnd);
 }
 EXPORT_SYMBOL_GPL(tcp_slow_start);