Subject: Re: [PATCH] limit rt cache size

From: Andi Kleen <[email-masked]>
Date: Tue, 8 Aug 2006 08:53:03 +0200

> 
> Whereas it should probably go:
> 
> 	if (max == 0) {
> 		max = (flags & HASH_HIGHMEM) ? nr_all_pages : nr_kernel_pages;
> 		max = (max << PAGE_SHIFT) >> 4;
> 		do_div(max, bucketsize);
> 	}
> 
> or something like that.

That's still too big. Consider a 2TB machine, with all memory in LOWMEM.

Or even a smaller system. At some point it doesn't make sense
anymore to go to a larger table, even if you have the memory
and it is actually costly to have a larger table because walking
the table (netstat, route etc.) completely will take longer and longer.

It needs some additional limit. Either a maximum one or something dynamic
like CPU cache sizes (but there is currently no portable way to get that)

-Andi