Re: [PATCH] Fix ppc64 max_pfn issue

From: Chris Wedgwood
Date: Sat Jul 24 2004 - 01:10:31 EST


On Sat, Jul 24, 2004 at 02:47:20PM +1000, Anton Blanchard wrote:

> I noticed excessive time in the pid hash functions on a ppc64
> box. It turns out the pid hash is being sized way too small, eg on a
> 16GB box:

This reminds me (that someone pointed out to me, I forget who) that in
pid.c we have:

void __init pidhash_init(void)
{
int i, j, pidhash_size;
unsigned long megabytes = max_pfn >> (20 - PAGE_SHIFT);

pidhash_shift = max(4, fls(megabytes * 4));
pidhash_shift = min(12, pidhash_shift);
pidhash_size = 1 << pidhash_shift;

which isn't strictly correct for machines with sparse/discontiguous
memory as max_pfn may have very little bearing on the overall memory
size.

Since we cap it at 1<<12 I guess the platform affected might be ARM
where you would otherwise get a smaller hash size. That said, I
wonder if a shift of 12 suffices for really large machines with many
many processes.


--cw
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/