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

From: Karsten Desler <[email-masked]>
Date: Tue, 7 Dec 2004 22:10:35 +0100

Karsten Desler <[email-masked]> 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
--- 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++)