* [PATCH 1/2] tcp-lp 2.6.18-rc6: fix tcp_lp_remote_hz_estimator() about rhz
@ 2006-09-04 9:44 Wong Edison
2006-12-03 12:32 ` Frank van Maarseveen
0 siblings, 1 reply; 3+ messages in thread
From: Wong Edison @ 2006-09-04 9:44 UTC (permalink / raw)
To: netdev, Stephen Hemminger, David S. Miller
pageexec report an oops for tcp_lp_owd_calculator(). This is due to
tcp_lp_remote_hz_estimator can return 0.
This patch fix the handling of lp->flag, so will set lp->flag as FALSE
if rhz <= 0
Signed-off-by: Wong Hoi Sing Edison <hswong3i@gmail.com>
---
diff -urpN 2.6.18-rc6/tcp_lp.c tcp-lp/tcp_lp.c
--- 2.6.18-rc6/tcp_lp.c 2006-09-04 16:21:00.000000000 +0800
+++ tcp-lp/tcp_lp.c 2006-09-04 17:22:19.000000000 +0800
@@ -153,14 +157,17 @@ static u32 tcp_lp_remote_hz_estimator(st
if (m < 0)
m = -m;
- if (rhz != 0) {
+ if (rhz > 0) {
m -= rhz >> 6; /* m is now error in remote HZ est */
rhz += m; /* 63/64 old + 1/64 new */
} else
rhz = m << 6;
/* record time for successful remote HZ calc */
- lp->flag |= LP_VALID_RHZ;
+ if (rhz > 0)
+ lp->flag |= LP_VALID_RHZ;
+ else
+ lp->flag &= ~LP_VALID_RHZ;
out:
/* record reference time stamp */
--
VGER BF report: U 0.500057
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] tcp-lp 2.6.18-rc6: fix tcp_lp_remote_hz_estimator() about rhz
2006-09-04 9:44 [PATCH 1/2] tcp-lp 2.6.18-rc6: fix tcp_lp_remote_hz_estimator() about rhz Wong Edison
@ 2006-12-03 12:32 ` Frank van Maarseveen
2006-12-11 6:40 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Frank van Maarseveen @ 2006-12-03 12:32 UTC (permalink / raw)
To: netdev
On Mon, Sep 04, 2006 at 05:44:58PM +0800, Wong Edison wrote:
> pageexec report an oops for tcp_lp_owd_calculator(). This is due to
> tcp_lp_remote_hz_estimator can return 0.
>
> This patch fix the handling of lp->flag, so will set lp->flag as FALSE
> if rhz <= 0
>
> Signed-off-by: Wong Hoi Sing Edison <hswong3i@gmail.com>
>
> ---
>
> diff -urpN 2.6.18-rc6/tcp_lp.c tcp-lp/tcp_lp.c
> --- 2.6.18-rc6/tcp_lp.c 2006-09-04 16:21:00.000000000 +0800
> +++ tcp-lp/tcp_lp.c 2006-09-04 17:22:19.000000000 +0800
> @@ -153,14 +157,17 @@ static u32 tcp_lp_remote_hz_estimator(st
> if (m < 0)
> m = -m;
>
> - if (rhz != 0) {
> + if (rhz > 0) {
> m -= rhz >> 6; /* m is now error in remote HZ est */
> rhz += m; /* 63/64 old + 1/64 new */
> } else
> rhz = m << 6;
>
> /* record time for successful remote HZ calc */
> - lp->flag |= LP_VALID_RHZ;
> + if (rhz > 0)
> + lp->flag |= LP_VALID_RHZ;
> + else
> + lp->flag &= ~LP_VALID_RHZ;
>
> out:
> /* record reference time stamp */
>
> --
> VGER BF report: U 0.500057
Got bitten by this zerodivide in 2.6.18.* (every few days a panic inside
an interrupt handler) and it doesn't seem to be fixed in 2.6.19.
--
Frank
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] tcp-lp 2.6.18-rc6: fix tcp_lp_remote_hz_estimator() about rhz
2006-12-03 12:32 ` Frank van Maarseveen
@ 2006-12-11 6:40 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2006-12-11 6:40 UTC (permalink / raw)
To: frankvm; +Cc: netdev
From: Frank van Maarseveen <frankvm@frankvm.com>
Date: Sun, 3 Dec 2006 13:32:07 +0100
> On Mon, Sep 04, 2006 at 05:44:58PM +0800, Wong Edison wrote:
> > pageexec report an oops for tcp_lp_owd_calculator(). This is due to
> > tcp_lp_remote_hz_estimator can return 0.
> >
> > This patch fix the handling of lp->flag, so will set lp->flag as FALSE
> > if rhz <= 0
> >
> > Signed-off-by: Wong Hoi Sing Edison <hswong3i@gmail.com>
> >
> > ---
> >
> > diff -urpN 2.6.18-rc6/tcp_lp.c tcp-lp/tcp_lp.c
> > --- 2.6.18-rc6/tcp_lp.c 2006-09-04 16:21:00.000000000 +0800
> > +++ tcp-lp/tcp_lp.c 2006-09-04 17:22:19.000000000 +0800
> > @@ -153,14 +157,17 @@ static u32 tcp_lp_remote_hz_estimator(st
> > if (m < 0)
> > m = -m;
> >
> > - if (rhz != 0) {
> > + if (rhz > 0) {
> > m -= rhz >> 6; /* m is now error in remote HZ est */
> > rhz += m; /* 63/64 old + 1/64 new */
> > } else
> > rhz = m << 6;
> >
> > /* record time for successful remote HZ calc */
> > - lp->flag |= LP_VALID_RHZ;
> > + if (rhz > 0)
> > + lp->flag |= LP_VALID_RHZ;
> > + else
> > + lp->flag &= ~LP_VALID_RHZ;
> >
> > out:
> > /* record reference time stamp */
> >
> > --
> > VGER BF report: U 0.500057
>
> Got bitten by this zerodivide in 2.6.18.* (every few days a panic inside
> an interrupt handler) and it doesn't seem to be fixed in 2.6.19.
That patch doesn't even apply, because the following other
patch from Wong is in the tree which conflicts. So I can't
apply this other fix of his, even if I wanted to.
commit bfbea8a8869a0e21b97605841d04190d63665d19
Author: Wong Hoi Sing Edison <hswong3i@gmail.com>
Date: Thu Sep 28 14:40:21 2006 -0700
[TCP] tcp-lp: prevent chance for oops
This patch fix the chance for tcp_lp_remote_hz_estimator return 0, if
0 < rhz < 64. It also make sure the flag LP_VALID_RHZ is set
correctly.
Signed-off-by: Wong Hoi Sing Edison <hswong3i@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/net/ipv4/tcp_lp.c b/net/ipv4/tcp_lp.c
index 308fb7e..f0ebaf0 100644
--- a/net/ipv4/tcp_lp.c
+++ b/net/ipv4/tcp_lp.c
@@ -31,8 +31,6 @@
* Hung Hing Lun, Mike <hlhung3i@gmail.com>
* SourceForge project page:
* http://tcp-lp-mod.sourceforge.net/
- *
- * Version: $Id: tcp_lp.c,v 1.24 2006/09/05 20:22:53 hswong3i Exp $
*/
#include <linux/module.h>
@@ -164,7 +162,7 @@ static u32 tcp_lp_remote_hz_estimator(st
out:
/* record time for successful remote HZ calc */
- if (rhz > 0)
+ if ((rhz >> 6) > 0)
lp->flag |= LP_VALID_RHZ;
else
lp->flag &= ~LP_VALID_RHZ;
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-12-11 6:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-04 9:44 [PATCH 1/2] tcp-lp 2.6.18-rc6: fix tcp_lp_remote_hz_estimator() about rhz Wong Edison
2006-12-03 12:32 ` Frank van Maarseveen
2006-12-11 6:40 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).