* [PATCH] codel: refine one condition to avoid a nul rec_inv_sqrt
@ 2012-07-30 6:52 Eric Dumazet
2012-07-30 21:54 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2012-07-30 6:52 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Anton Mich
From: Eric Dumazet <edumazet@google.com>
One condition before codel_Newton_step() was not good if
we never left the dropping state for a flow. As a result
rec_inv_sqrt was 0, instead of the ~0 initial value.
codel control law was then set to a very aggressive mode, dropping
many packets before reaching 'target' and recovering from this problem.
To keep codel_vars_init() as efficient as possible, refine
the condition to make sure rec_inv_sqrt initial value is correct
Many thanks to Anton Mich for discovering the issue and suggesting
a fix.
Reported-by: Anton Mich <lp2s1h@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/net/codel.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/net/codel.h b/include/net/codel.h
index 550debf..389cf62 100644
--- a/include/net/codel.h
+++ b/include/net/codel.h
@@ -305,6 +305,8 @@ static struct sk_buff *codel_dequeue(struct Qdisc *sch,
}
}
} else if (drop) {
+ u32 delta;
+
if (params->ecn && INET_ECN_set_ce(skb)) {
stats->ecn_mark++;
} else {
@@ -320,9 +322,11 @@ static struct sk_buff *codel_dequeue(struct Qdisc *sch,
* assume that the drop rate that controlled the queue on the
* last cycle is a good starting point to control it now.
*/
- if (codel_time_before(now - vars->drop_next,
+ delta = vars->count - vars->lastcount;
+ if (delta > 1 &&
+ codel_time_before(now - vars->drop_next,
16 * params->interval)) {
- vars->count = (vars->count - vars->lastcount) | 1;
+ vars->count = delta;
/* we dont care if rec_inv_sqrt approximation
* is not very precise :
* Next Newton steps will correct it quadratically.
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] codel: refine one condition to avoid a nul rec_inv_sqrt
2012-07-30 6:52 [PATCH] codel: refine one condition to avoid a nul rec_inv_sqrt Eric Dumazet
@ 2012-07-30 21:54 ` David Miller
2012-08-10 15:16 ` Eric Dumazet
0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2012-07-30 21:54 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, lp2s1h
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 30 Jul 2012 08:52:21 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> One condition before codel_Newton_step() was not good if
> we never left the dropping state for a flow. As a result
> rec_inv_sqrt was 0, instead of the ~0 initial value.
>
> codel control law was then set to a very aggressive mode, dropping
> many packets before reaching 'target' and recovering from this problem.
>
> To keep codel_vars_init() as efficient as possible, refine
> the condition to make sure rec_inv_sqrt initial value is correct
>
> Many thanks to Anton Mich for discovering the issue and suggesting
> a fix.
>
> Reported-by: Anton Mich <lp2s1h@gmail.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied and queued up for -stable.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] codel: refine one condition to avoid a nul rec_inv_sqrt
2012-07-30 21:54 ` David Miller
@ 2012-08-10 15:16 ` Eric Dumazet
2012-08-10 23:54 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2012-08-10 15:16 UTC (permalink / raw)
To: David Miller; +Cc: netdev, lp2s1h
On Mon, 2012-07-30 at 14:54 -0700, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Mon, 30 Jul 2012 08:52:21 +0200
>
> > From: Eric Dumazet <edumazet@google.com>
> >
> > One condition before codel_Newton_step() was not good if
> > we never left the dropping state for a flow. As a result
> > rec_inv_sqrt was 0, instead of the ~0 initial value.
> >
> > codel control law was then set to a very aggressive mode, dropping
> > many packets before reaching 'target' and recovering from this problem.
> >
> > To keep codel_vars_init() as efficient as possible, refine
> > the condition to make sure rec_inv_sqrt initial value is correct
> >
> > Many thanks to Anton Mich for discovering the issue and suggesting
> > a fix.
> >
> > Reported-by: Anton Mich <lp2s1h@gmail.com>
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
>
> Applied and queued up for -stable.
Hi David, I think this patch got lost somehow ?
Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] codel: refine one condition to avoid a nul rec_inv_sqrt
2012-08-10 15:16 ` Eric Dumazet
@ 2012-08-10 23:54 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-08-10 23:54 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, lp2s1h
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 10 Aug 2012 17:16:11 +0200
> On Mon, 2012-07-30 at 14:54 -0700, David Miller wrote:
>> From: Eric Dumazet <eric.dumazet@gmail.com>
>> Date: Mon, 30 Jul 2012 08:52:21 +0200
>>
>> > From: Eric Dumazet <edumazet@google.com>
>> >
>> > One condition before codel_Newton_step() was not good if
>> > we never left the dropping state for a flow. As a result
>> > rec_inv_sqrt was 0, instead of the ~0 initial value.
>> >
>> > codel control law was then set to a very aggressive mode, dropping
>> > many packets before reaching 'target' and recovering from this problem.
>> >
>> > To keep codel_vars_init() as efficient as possible, refine
>> > the condition to make sure rec_inv_sqrt initial value is correct
>> >
>> > Many thanks to Anton Mich for discovering the issue and suggesting
>> > a fix.
>> >
>> > Reported-by: Anton Mich <lp2s1h@gmail.com>
>> > Signed-off-by: Eric Dumazet <edumazet@google.com>
>>
>> Applied and queued up for -stable.
>
> Hi David, I think this patch got lost somehow ?
Thanks for catching this, I've corrected it now.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-08-10 23:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-30 6:52 [PATCH] codel: refine one condition to avoid a nul rec_inv_sqrt Eric Dumazet
2012-07-30 21:54 ` David Miller
2012-08-10 15:16 ` Eric Dumazet
2012-08-10 23:54 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.