[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B7452@saturn3.aculab.com>
Date: Mon, 2 Dec 2013 10:29:23 -0000
From: "David Laight" <David.Laight@...LAB.COM>
To: "David Miller" <davem@...emloft.net>
Cc: <yangyingliang@...wei.com>, <eric.dumazet@...il.com>,
<netdev@...r.kernel.org>, <brouer@...hat.com>, <jpirko@...hat.com>,
<jbrouer@...hat.com>
Subject: RE: [PATCH] net: sched: tbf: fix calculation of max_size
> -----Original Message-----
> From: netdev-owner@...r.kernel.org [mailto:netdev-owner@...r.kernel.org] On Behalf Of David Miller
> Sent: 02 December 2013 01:11
> To: David Laight
> Cc: yangyingliang@...wei.com; eric.dumazet@...il.com; netdev@...r.kernel.org; brouer@...hat.com;
> jpirko@...hat.com; jbrouer@...hat.com
> Subject: Re: [PATCH] net: sched: tbf: fix calculation of max_size
>
> From: "David Laight" <David.Laight@...LAB.COM>
> Date: Mon, 25 Nov 2013 12:22:30 -0000
>
> >> From: Yang Yingliang <yangyingliang@...wei.com>
> >>
> >> Current max_size is caluated from rate table. Now, the rate table
> >> has been replaced and it's wrong to caculate max_size based on this
> >> rate table. It can lead wrong calculation of max_size.
> >>
> >> The burst in kernel may be lower than user asked, because burst may gets
> >> some loss when transform it to buffer(E.g. "burst 40kb rate 30mbit/s")
> >> and it seems we cannot avoid this loss. And burst's value(max_size) based
> >> on rate table may be equal user asked. If a packet's length is max_size,
> >> this packet will be stalled in tbf_dequeue() because its length is above
> >> the burst in kernel so that it cannot get enough tokens. The max_size guards
> >> against enqueuing packet sizes above q->buffer "time" in tbf_enqueue().
> >
> > Why not adjust the calculations so that the number of allocated tokens
> > can go negative?
> >
> > So allow the transfer if the number of tokens is +ve and then subtract
> > the number needed for the message itself.
> >
> > I think this would change the semantics of the configured 'burst' value
> > very slightly (to 'at least' from 'at most') but the average would still
> > be correct.
> >
> > FWIW I've done similar rate limiters that run directly in units of 'time'.
> > The fact that system time advances automatically generates credit.
>
> Yang has responded to your concerns, are they addressed?
I was mostly making some suggestions that might have made fixing it easier.
So I'm not really worried.
David
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists