Skip to contentSkip to conversation

x86: correct internode cache alignment

PATCH In review Alex Shi 1 participant 2 messages Mar 3, 2012 – Mar 5, 2012 x86

lore
Share & tools
lore

Alex Shi

author
#0 lore raw

PATCH 1/1 x86: correct internode cache alignment

Currently cache alignment among nodes in kernel is still 128 bytes on NUMA machine, that get from old P4 processors. But now most of modern CPU use the same size: 64 bytes from L1 to last level L3. so let's remove the incorrect setting, and directly use the L1 cache size to do SMP cache line alignment.

This patch save some memory space on kernel data. The System.map is quite different with/without this change:

before patched after patched
...

  000000000000b000 d tlb_vector_|  000000000000b000 d tlb_vector
  000000000000b080 d cpu_loops_p|  000000000000b040 d cpu_loops_

...

---
 arch/x86/Kconfig.cpu |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/x86/Kconfig.cpu +0 -1
index 3c57033..6443c6f 100644
@@ -303,7 +303,6 @@ config X86_GENERIC
 config X86_INTERNODE_CACHE_SHIFT
 	int
 	default "12" if X86_VSMP
-	default "7" if NUMA
 	default X86_L1_CACHE_SHIFT
 
 config X86_CMPXCHG
Signature · 1 line
1.6.3.3
#1 lore raw

[tip:x86/asm] x86/numa: Improve internode cache alignment

Commit-ID:  901b04450a0ff44d579158b8b0492ce7e66cd442
Gitweb:     http://git.kernel.org/tip/901b04450a0ff44d579158b8b0492ce7e66cd442
Author:     Alex Shi <[email protected]>
AuthorDate: Sat, 3 Mar 2012 19:27:27 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 5 Mar 2012 09:19:20 +0100

x86/numa: Improve internode cache alignment

Currently cache alignment among nodes in the kernel is still 128 bytes on x86 NUMA machines - we got that X86_INTERNODE_CACHE_SHIFT default from old P4 processors.

But now most modern x86 CPUs use the same size: 64 bytes from L1 to last level L3. so let's remove the incorrect setting, and directly use the L1 cache size to do SMP cache line alignment.

This patch saves some memory space on kernel data, and it also improves the cache locality of kernel data.

The System.map is quite different with/without this change:

before patch after patch
...

  000000000000b000 d tlb_vector_|  000000000000b000 d tlb_vector
  000000000000b080 d cpu_loops_p|  000000000000b040 d cpu_loops_

...

---
 arch/x86/Kconfig.cpu |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/x86/Kconfig.cpu +0 -1
index 3c57033..6443c6f 100644
@@ -303,7 +303,6 @@ config X86_GENERIC
 config X86_INTERNODE_CACHE_SHIFT
 	int
 	default "12" if X86_VSMP
-	default "7" if NUMA
 	default X86_L1_CACHE_SHIFT
 
 config X86_CMPXCHG