From: Eric Dumazet Subject: Re: [PATCH net-next] net: netem: use a list in addition to rbtree Date: Tue, 4 Dec 2018 07:57:15 -0800 Message-ID: <3d74a813-326b-43dd-0a05-d637cae5c0fd@gmail.com> References: <20181204010712.255768-1-posk@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Peter Oskolkov , Eric Dumazet To: Peter Oskolkov , David Miller , netdev@vger.kernel.org Return-path: Received: from mail-pl1-f193.google.com ([209.85.214.193]:41435 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726042AbeLDP5R (ORCPT ); Tue, 4 Dec 2018 10:57:17 -0500 Received: by mail-pl1-f193.google.com with SMTP id u6so8495001plm.8 for ; Tue, 04 Dec 2018 07:57:17 -0800 (PST) In-Reply-To: <20181204010712.255768-1-posk@google.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 12/03/2018 05:07 PM, Peter Oskolkov wrote: > 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 > Signed-off-by: Peter Oskolkov > --- Reviewed-by: Eric Dumazet Thanks Peter !