Re: 2.6.13-rc4 - kernel panic - BUG at net/ipv4/tcp_output.c:918

2005-08-04 Thread Andrew Morton
Guillaume Pelat <[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> Herbert Xu wrote:
> > On Thu, Aug 04, 2005 at 01:33:29PM +1000, herbert wrote:
> > 
> >>So I suppose we should reset cwnd_quota after tcp_transmit_skb?
> > 
> > Please try this patch to see if this is really the problem or not.
> > 
> > Thanks,
> 
> I just applied your patch, and it seems to work :)
> 2 hours uptime, and no crash yet (without the patch, it was crashing a 
> few mins only after booting).
> So i think the bug is crushed :)
> 

Thanks, Guillaume.  Herbert, David is travelling and not able to do a lot
of patchmonkeying.  Could you please prepare and submit a final patch?

Thanks.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.13-rc4 - kernel panic - BUG at net/ipv4/tcp_output.c:918

2005-08-04 Thread Guillaume Pelat

Hi,

Herbert Xu wrote:

On Thu, Aug 04, 2005 at 01:33:29PM +1000, herbert wrote:


So I suppose we should reset cwnd_quota after tcp_transmit_skb?


Please try this patch to see if this is really the problem or not.

Thanks,


I just applied your patch, and it seems to work :)
2 hours uptime, and no crash yet (without the patch, it was crashing a 
few mins only after booting).

So i think the bug is crushed :)

Thanks a lot !

--
Guillaume Pelat
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.13-rc4 - kernel panic - BUG at net/ipv4/tcp_output.c:918

2005-08-04 Thread Herbert Xu
On Thu, Aug 04, 2005 at 01:33:29PM +1000, herbert wrote:
> 
> So I suppose we should reset cwnd_quota after tcp_transmit_skb?

Please try this patch to see if this is really the problem or not.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1027,19 +1027,14 @@ static int tcp_write_xmit(struct sock *s
tcp_minshall_update(tp, mss_now, skb);
sent_pkts++;
 
-   /* Do not optimize this to use tso_segs. If we chopped up
-* the packet above, tso_segs will no longer be valid.
-*/
-   cwnd_quota -= tcp_skb_pcount(skb);
-
-   BUG_ON(cwnd_quota < 0);
-   if (!cwnd_quota)
-   break;
-
skb = sk->sk_send_head;
if (!skb)
break;
+
tso_segs = tcp_init_tso_segs(sk, skb, mss_now);
+   cwnd_quota = tcp_cwnd_test(tp, skb);
+   if (!cwnd_quota)
+   break;
}
 
if (likely(sent_pkts)) {


Re: 2.6.13-rc4 - kernel panic - BUG at net/ipv4/tcp_output.c:918

2005-08-04 Thread Herbert Xu
On Thu, Aug 04, 2005 at 01:33:29PM +1000, herbert wrote:
 
 So I suppose we should reset cwnd_quota after tcp_transmit_skb?

Please try this patch to see if this is really the problem or not.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1027,19 +1027,14 @@ static int tcp_write_xmit(struct sock *s
tcp_minshall_update(tp, mss_now, skb);
sent_pkts++;
 
-   /* Do not optimize this to use tso_segs. If we chopped up
-* the packet above, tso_segs will no longer be valid.
-*/
-   cwnd_quota -= tcp_skb_pcount(skb);
-
-   BUG_ON(cwnd_quota  0);
-   if (!cwnd_quota)
-   break;
-
skb = sk-sk_send_head;
if (!skb)
break;
+
tso_segs = tcp_init_tso_segs(sk, skb, mss_now);
+   cwnd_quota = tcp_cwnd_test(tp, skb);
+   if (!cwnd_quota)
+   break;
}
 
if (likely(sent_pkts)) {


Re: 2.6.13-rc4 - kernel panic - BUG at net/ipv4/tcp_output.c:918

2005-08-04 Thread Guillaume Pelat

Hi,

Herbert Xu wrote:

On Thu, Aug 04, 2005 at 01:33:29PM +1000, herbert wrote:


So I suppose we should reset cwnd_quota after tcp_transmit_skb?


Please try this patch to see if this is really the problem or not.

Thanks,


I just applied your patch, and it seems to work :)
2 hours uptime, and no crash yet (without the patch, it was crashing a 
few mins only after booting).

So i think the bug is crushed :)

Thanks a lot !

--
Guillaume Pelat
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.13-rc4 - kernel panic - BUG at net/ipv4/tcp_output.c:918

2005-08-04 Thread Andrew Morton
Guillaume Pelat [EMAIL PROTECTED] wrote:

 Hi,
 
 Herbert Xu wrote:
  On Thu, Aug 04, 2005 at 01:33:29PM +1000, herbert wrote:
  
 So I suppose we should reset cwnd_quota after tcp_transmit_skb?
  
  Please try this patch to see if this is really the problem or not.
  
  Thanks,
 
 I just applied your patch, and it seems to work :)
 2 hours uptime, and no crash yet (without the patch, it was crashing a 
 few mins only after booting).
 So i think the bug is crushed :)
 

Thanks, Guillaume.  Herbert, David is travelling and not able to do a lot
of patchmonkeying.  Could you please prepare and submit a final patch?

Thanks.

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.13-rc4 - kernel panic - BUG at net/ipv4/tcp_output.c:918

2005-08-03 Thread Herbert Xu
On Mon, Aug 01, 2005 at 08:33:20AM +, Guillaume Pelat wrote:
> 
> I just tried the patch attached. :)
> 
> The bug is still here (same symptoms), with a slightly different backtrace :
> [ cut here ]
> kernel BUG at net/ipv4/tcp_output.c:918!

OK, let's try again :)

I bet it's the tcp_enter_cwr() call in tcp_transmit_skb().  So
the sequence is:

tcp_write_xmit
cwnd_quota = tcp_cwnd_test
tcp_transmit_skb
tcp_enter_cwr
tp->snd_cwnd = min(tp->snd_cwnd, in_flight + 1)

At this point cwnd_quota is out-of-sync with tp->snd_cwnd.

cwnd_quota -= tcp_skb_pcount(skb)
cwnd_quota > 0
tcp_tso_should_defer
BUG since tp->snd_cwnd is smaller than what
cwnd_quota indicated.

So I suppose we should reset cwnd_quota after tcp_transmit_skb?

Perhaps we should only transmit one MSS in this case?

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.13-rc4 - kernel panic - BUG at net/ipv4/tcp_output.c:918

2005-08-03 Thread Herbert Xu
On Mon, Aug 01, 2005 at 08:33:20AM +, Guillaume Pelat wrote:
 
 I just tried the patch attached. :)
 
 The bug is still here (same symptoms), with a slightly different backtrace :
 [ cut here ]
 kernel BUG at net/ipv4/tcp_output.c:918!

OK, let's try again :)

I bet it's the tcp_enter_cwr() call in tcp_transmit_skb().  So
the sequence is:

tcp_write_xmit
cwnd_quota = tcp_cwnd_test
tcp_transmit_skb
tcp_enter_cwr
tp-snd_cwnd = min(tp-snd_cwnd, in_flight + 1)

At this point cwnd_quota is out-of-sync with tp-snd_cwnd.

cwnd_quota -= tcp_skb_pcount(skb)
cwnd_quota  0
tcp_tso_should_defer
BUG since tp-snd_cwnd is smaller than what
cwnd_quota indicated.

So I suppose we should reset cwnd_quota after tcp_transmit_skb?

Perhaps we should only transmit one MSS in this case?

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/