lkml.org 
[lkml]   [2006]   [Nov]   [10]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
FromAndi Kleen <>
SubjectRe: [PATCH] x86_64: Make the NUMA hash function nodemap allocation dynamic and remove NODEMAPSIZE
DateFri, 10 Nov 2006 07:48:30 +0100
> 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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-11-10 06:51    [from the cache]
©2003-2008