]> git.baikalelectronics.ru Git - kernel.git/commit
net: netem: use a list in addition to rbtree
authorPeter Oskolkov <posk@google.com>
Tue, 4 Dec 2018 19:55:56 +0000 (11:55 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Dec 2018 04:18:41 +0000 (20:18 -0800)
commit785bd8540bf20046c1d5432511cab9409963481f
tree888236ef605669fde8635a6a1c5e52af173e9b8f
parent6ffb0e092c5adfbcf83bb56cc973de9a9ef80f15
net: netem: use a list in addition to rbtree

When testing high-bandwidth TCP streams with large windows,
high latency, and low jitter, netem consumes a lot of CPU cycles
doing rbtree rebalancing.

This patch uses a linear list/queue in addition to the rbtree:
if an incoming packet is past the tail of the linear queue, it is
added there, otherwise it is inserted into the rbtree.

Without this patch, perf shows netem_enqueue, netem_dequeue,
and rb_* functions among the top offenders. With this patch,
only netem_enqueue is noticeable if jitter is low/absent.

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Peter Oskolkov <posk@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_netem.c