cbq: incorrectly low bandwidth setting blocks limited traffic
authorVasily Averin <vvs@parallels.com>
Thu, 14 Aug 2014 08:27:47 +0000 (12:27 +0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Aug 2014 17:58:44 +0000 (10:58 -0700)
commit73d0f37ac4ee5b60e6b9c1b3ccb8766bade9d9c5
treeadaf72c8208c62eed0d4e6a74983cb8f6741ab03
parentac32c7f705692b92fe12dcbe88fe87136fdfff6f
cbq: incorrectly low bandwidth setting blocks limited traffic

Mainstream commit f0f6ee1f70c4 ("cbq: incorrect processing of high limits")
have side effect: if cbq bandwidth setting is less than real interface
throughput non-limited traffic can delay limited traffic for a very long time.

This happen because of q->now changes incorrectly in cbq_dequeue():
in described scenario L2T is much greater than real time delay,
and q->now gets an extra boost for each transmitted packet.

Accumulated boost prevents update q->now, and blocked class can wait
very long time until (q->now >= cl->undertime) will be true again.

To fix the problem the patch updates q->now on each cbq_update() call.
L2T-related pre-modification q->now was moved to cbq_update().

My testing confirmed that it fixes the problem and did not discover
any side-effects

Fixes: f0f6ee1f70c4 ("cbq: incorrect processing of high limits")

Signed-off-by: Vasily Averin <vvs@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_cbq.c