Re: RT_CACHE_SIZE_MAX

Thomas Bogendoerfer (tsbogend@alpha.franken.de)
Thu, 14 Aug 1997 23:16:41 +0200 (MEST)


> : Reason: I've a machine (PPro 200) that's spending 12% of kernel CPU
> : time garbage collecting the rt_cache. The machine is handling a LOT of IP
> : traffic to diverse destinations ( more than 1000 TCP flows is normal),
> : and it looks like the route cache is thrashing badly.
>
> It is the thing that I see in my nightmares :-)

maybe there is another reason for this behaviour. When profiling the kernel
on our main gateway (10Mb/s <-> 10Mb/s) ip_rt_run_bh() was one of the top
most called functions. We tracked it down to the point, that it's the
inlined rt_kick_free_queue(), which is called every time ip_rt_run_bh()
is called as soon as RT_BH_FREE is set in ip_rt_bh_mask. And this flag
is never reset. Below is a fix, which solved the problems on our gateway.
If this patch is correct, it should be part of 2.0.31.

Thomas.

--- linux/net/ipv4/route.c.orig Wed May 7 14:28:56 1997
+++ linux/net/ipv4/route.c Wed May 7 14:30:22 1997
@@ -936,6 +936,7 @@
}
rtp = &rt->rt_next;
}
+ ip_rt_bh_mask &= ~RT_BH_FREE;
}

void ip_rt_run_bh()

-- 
See, you not only have to be a good coder to create a system like Linux,
you have to be a sneaky bastard too ;-)
                   [Linus Torvalds in <4rikft$7g5@linux.cs.Helsinki.FI>]