Re: [PATCH] x86_64: Make the NUMA hash function nodemap allocation dynamic and remove NODEMAPSIZE

From: Andi Kleen
Date: Fri Nov 10 2006 - 01:49:25 EST



> diff -uprN linux-2.6.19-rc4/arch/x86_64/kernel/e820.c linux-2.6.19-rc4-az/arch/x86_64/kernel/e820.c
> --- linux-2.6.19-rc4/arch/x86_64/kernel/e820.c 2006-10-31 17:38:41.000000000 -0500
> +++ linux-2.6.19-rc4-az/arch/x86_64/kernel/e820.c 2006-11-08 17:55:48.000000000 -0500
> @@ -83,6 +83,12 @@ static inline int bad_addr(unsigned long
> return 1;
> }
>
> + /* NUMA memory to node map */
> + if (last >= nodemap_addr && addr < nodemap_addr + nodemap_size) {
> + *addrp = nodemap_addr + nodemap_size;
> + return 1;
> + }

Using the e820 allocator will now mean it's rounded up to pages.
That will waste a bit of memory, but i suppose it's ok.

> + for (i=20; !(bitfield&(1UL << i)) && i<BITS_PER_LONG; i++);

That's find_first_bit() ? Please use that

>
> + shift = extract_lsb_from_nodes(nodes, numnodes);
> + if ( allocate_cachealigned_memnodemap() )

No extra spaces here please (and in some other places)


> + u8 *map;
> + u8 zero;

zero?

> } ____cacheline_aligned;
> extern struct memnode memnode;
> #define memnode_shift memnode.shift
> #define memnodemap memnode.map
> +#define memnodemapsize memnode.mapsize

Have you checked how much the code .text size changes because
of the pointer reference? If it's a lot phys_to_nid might need to
be out of lined.

-Andi
-
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/