[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 <dada1@cosmosbay.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Eric Dumazet
2006-03-25 16:31:46 +01:00
committed by Linus Torvalds
parent 40caa88465
commit dcf36bfa5d
2 changed files with 9 additions and 6 deletions
+7 -2
View File
@@ -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[];