Subject: Re: [PATCH] limit rt cache size

From: Eric Dumazet <[email-masked]>
Date: Wed, 9 Aug 2006 10:53:18 +0200

On Wednesday 09 August 2006 10:09, Kirill Korotaev wrote:
> >>2) for cases where we haven't implemented dynamic
> >>   table growth, specifying a proper limit argument
> >>   to the hash table allocation is a sufficient
> >>   solution for the time being
> >
> > Agreed, just we don't know what the proper limits are.
> >
> > I guess it would need someone running quite a lot of benchmarks.
> > Anyone volunteering? @)
>
> In my original post I noted how it is quite easy to consume
> the whole 1Gb of RAM on i686 PC (and it's only 4,194,304 entries)
> it looks like with more IP addresses it is not that hard to
> consume much more memory.

If MAX_ORDER = 11, we have a max hash table of 8 MB : 2097152 slots
But even 2097152 dst need 139810 pages (560 MB of low mem), so 16 times 
needs... too much ram.

Probably a test like this is necessary :

if (ip_rt_max_size > (nr_kernel_pages/8))
    ip_rt_max_size = (nr_kernel_pages/8);

Eric