[Top] [All Lists]

Re: _High_ CPU usage while routing (mostly) small UDP packets

To: Karsten Desler <kdesler@xxxxxxxxxx>
Subject: Re: _High_ CPU usage while routing (mostly) small UDP packets
From: P@xxxxxxxxxxxxxx
Date: Tue, 07 Dec 2004 10:47:52 +0000
Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>, netdev@xxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
In-reply-to: <20041206224107.GA8529@xxxxxxxxxx>
References: <20041206205305.GA11970@xxxxxxxxxx> <20041206134849.498bfc93.davem@xxxxxxxxxxxxx> <20041206224107.GA8529@xxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040124
Karsten Desler wrote:
* David S. Miller wrote:

It's spending nearly half of it's time in iptables.
Try to consolidate your rules if possible.  This is the
part of netfilter that really doesn't scale well at all.

Removing the iptables rules helps reducing the load a little, but the
majority of time is still spent somewhere else.

Well with NAPI it can be hard to tell CPU usage.
You may need to use something like cyclesoak to get
a true idea of CPU left.

Also have a look at as netfilter
has silly scalability properties.

I also notice that a lot of time is spent allocating
and freeing the packet buffers (and possible hidden
time due to cache misses due to allocating on one
CPU and freeing on another?).
How many [RT]xDescriptors do you have configured by the way?

Anyway attached is a small patch that I used to make the e1000
"own" the packet buffers, and hence it does not alloc/free
per packet at all. Now this has only been tested in one
configuration where I was just sniffing the packets, so
definitely YMMV.

Pádraig Brady -

Attachment: linux-2.4.20-5.2.52-realloc.diff
Description: TeXInfo document

<Prev in Thread] Current Thread [Next in Thread>