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

Karsten Desler
2004-12-07T21:10:47Z

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]

Karsten Desler <kdesler@soohrt.org> wrote:
> Current packetload on eth0 (and reversed on eth1):
> 115kpps tx
> 135kpps rx

I totally forgot to mention: There are approximately 100k concurrent
flows.

>From dmesg:
IP: routing cache hash table of 16384 buckets, 128Kbytes

Maybe there is some contention on the rt_hash_table spinlocks?
Is the attached patch enough to increase the size?

- Karsten

[-- Attachment #2: rtcachesize.patch --]
[-- Type: text/plain, Size: 472 bytes --]

--- linux/net/ipv4/route.c~old 2004-12-07 21:55:22.000000000 +0100
+++ linux/net/ipv4/route.c 2004-12-07 21:55:32.000000000 +0100
@@ -2728,7 +2728,7 @@
if (!ipv4_dst_ops.kmem_cachep)
panic("IP: failed to allocate ip_dst_cache\n");

- goal = num_physpages >> (26 - PAGE_SHIFT);
+ goal = num_physpages >> (23 - PAGE_SHIFT);
if (rhash_entries)
goal = (rhash_entries * sizeof(struct rt_hash_bucket)) >> PAGE_SHIFT;
for (order = 0; (1UL << order) < goal; order++)