Andi Kleen a écrit :
Can you send tested patches with proper descriptions and signed off lines
please?
-Andi
You are welcome Andi :)
[PATCH] x86_64 : group memnodemap and memnodeshift in a memnode structure
pfn_to_page() and others need to access both memnode_shift and the very first
bytes of memnodemap[]. If we force memnode_shift to be just before the
memnodemap array, we can reduce the memory footprint to one cache line instead
of two for most setups. This patch introduce a 'memnode' structure where shift
and map[] are carefully placed.
Signed-off-by: Eric Dumazet <[EMAIL PROTECTED]>
--- linux-2.6.16-rc5/include/asm-x86_64/mmzone.h 2006-02-27
06:09:35.000000000 +0100
+++ linux-2.6.16-rc5-ed/include/asm-x86_64/mmzone.h 2006-03-08
12:05:31.000000000 +0100
@@ -15,8 +15,13 @@
#define NODEMAPSIZE 0xfff
/* Simple perfect hash to map physical addresses to node numbers */
-extern int memnode_shift;
-extern u8 memnodemap[NODEMAPSIZE];
+struct memnode {
+ int shift;
+ u8 map[NODEMAPSIZE];
+} ____cacheline_aligned;
+extern struct memnode memnode;
+#define memnode_shift memnode.shift
+#define memnodemap memnode.map
extern struct pglist_data *node_data[];
--- linux-2.6.16-rc5/arch/x86_64/mm/numa.c 2006-02-27 06:09:35.000000000
+0100
+++ linux-2.6.16-rc5-ed/arch/x86_64/mm/numa.c 2006-03-08 12:28:32.000000000
+0100
@@ -25,8 +25,7 @@
struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
bootmem_data_t plat_node_bdata[MAX_NUMNODES];
-int memnode_shift;
-u8 memnodemap[NODEMAPSIZE];
+struct memnode memnode;
unsigned char cpu_to_node[NR_CPUS] __read_mostly = {
[0 ... NR_CPUS-1] = NUMA_NO_NODE
@@ -357,8 +356,7 @@
EXPORT_SYMBOL(cpu_to_node);
EXPORT_SYMBOL(node_to_cpumask);
-EXPORT_SYMBOL(memnode_shift);
-EXPORT_SYMBOL(memnodemap);
+EXPORT_SYMBOL(memnode);
EXPORT_SYMBOL(node_data);
#ifdef CONFIG_DISCONTIGMEM