diff options
author | Christoph Lameter <clameter@sgi.com> | 2008-01-30 07:30:47 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:30:47 -0500 |
commit | b263295dbffd33b0fbff670720fa178c30e3392a (patch) | |
tree | 014b402cb65b17e1521ed356e5c225083ea578dd /arch/x86/mm/srat_64.c | |
parent | 4ebd1290ba12121d66285cc06987ca97bcdfc55b (diff) |
x86: 64-bit, make sparsemem vmemmap the only memory model
Use sparsemem as the only memory model for UP, SMP and NUMA. Measurements
indicate that DISCONTIGMEM has a higher overhead than sparsemem. And
FLATMEMs benefits are minimal. So I think its best to simply standardize
on sparsemem.
Results of page allocator tests (test can be had via git from slab git
tree branch tests)
Measurements in cycle counts. 1000 allocations were performed and then the
average cycle count was calculated.
Order FlatMem Discontig SparseMem
0 639 665 641
1 567 647 593
2 679 774 692
3 763 967 781
4 961 1501 962
5 1356 2344 1392
6 2224 3982 2336
7 4869 7225 5074
8 12500 14048 12732
9 27926 28223 28165
10 58578 58714 58682
(Note that FlatMem is an SMP config and the rest NUMA configurations)
Memory use:
SMP Sparsemem
-------------
Kernel size:
text data bss dec hex filename
3849268 397739 1264856 5511863 541ab7 vmlinux
total used free shared buffers cached
Mem: 8242252 41164 8201088 0 352 11512
-/+ buffers/cache: 29300 8212952
Swap: 9775512 0 9775512
SMP Flatmem
-----------
Kernel size:
text data bss dec hex filename
3844612 397739 1264536 5506887 540747 vmlinux
So 4.5k growth in text size vs. FLATMEM.
total used free shared buffers cached
Mem: 8244052 40544 8203508 0 352 11484
-/+ buffers/cache: 28708 8215344
2k growth in overall memory use after boot.
NUMA discontig:
text data bss dec hex filename
3888124 470659 1276504 5635287 55fcd7 vmlinux
total used free shared buffers cached
Mem: 8256256 56908 8199348 0 352 11496
-/+ buffers/cache: 45060 8211196
Swap: 9775512 0 9775512
NUMA sparse:
text data bss dec hex filename
3896428 470659 1276824 5643911 561e87 vmlinux
8k text growth. Given that we fully inline virt_to_page and friends now
that is rather good.
total used free shared buffers cached
Mem: 8264720 57240 8207480 0 352 11516
-/+ buffers/cache: 45372 8219348
Swap: 9775512 0 9775512
The total available memory is increased by 8k.
This patch makes sparsemem the default and removes discontig and
flatmem support from x86.
[ akpm@linux-foundation.org: allnoconfig build fix ]
Acked-by: Andi Kleen <ak@suse.de>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm/srat_64.c')
-rw-r--r-- | arch/x86/mm/srat_64.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c index ea85172fc0cc..9be14171144b 100644 --- a/arch/x86/mm/srat_64.c +++ b/arch/x86/mm/srat_64.c | |||
@@ -151,62 +151,6 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa) | |||
151 | pxm, pa->apic_id, node); | 151 | pxm, pa->apic_id, node); |
152 | } | 152 | } |
153 | 153 | ||
154 | #ifdef CONFIG_MEMORY_HOTPLUG_RESERVE | ||
155 | /* | ||
156 | * Protect against too large hotadd areas that would fill up memory. | ||
157 | */ | ||
158 | static int hotadd_enough_memory(struct bootnode *nd) | ||
159 | { | ||
160 | static unsigned long allocated; | ||
161 | static unsigned long last_area_end; | ||
162 | unsigned long pages = (nd->end - nd->start) >> PAGE_SHIFT; | ||
163 | long mem = pages * sizeof(struct page); | ||
164 | unsigned long addr; | ||
165 | unsigned long allowed; | ||
166 | unsigned long oldpages = pages; | ||
167 | |||
168 | if (mem < 0) | ||
169 | return 0; | ||
170 | allowed = (end_pfn - absent_pages_in_range(0, end_pfn)) * PAGE_SIZE; | ||
171 | allowed = (allowed / 100) * hotadd_percent; | ||
172 | if (allocated + mem > allowed) { | ||
173 | unsigned long range; | ||
174 | /* Give them at least part of their hotadd memory upto hotadd_percent | ||
175 | It would be better to spread the limit out | ||
176 | over multiple hotplug areas, but that is too complicated | ||
177 | right now */ | ||
178 | if (allocated >= allowed) | ||
179 | return 0; | ||
180 | range = allowed - allocated; | ||
181 | pages = (range / PAGE_SIZE); | ||
182 | mem = pages * sizeof(struct page); | ||
183 | nd->end = nd->start + range; | ||
184 | } | ||
185 | /* Not completely fool proof, but a good sanity check */ | ||
186 | addr = find_e820_area(last_area_end, end_pfn<<PAGE_SHIFT, mem); | ||
187 | if (addr == -1UL) | ||
188 | return 0; | ||
189 | if (pages != oldpages) | ||
190 | printk(KERN_NOTICE "SRAT: Hotadd area limited to %lu bytes\n", | ||
191 | pages << PAGE_SHIFT); | ||
192 | last_area_end = addr + mem; | ||
193 | allocated += mem; | ||
194 | return 1; | ||
195 | } | ||
196 | |||
197 | static int update_end_of_memory(unsigned long end) | ||
198 | { | ||
199 | found_add_area = 1; | ||
200 | if ((end >> PAGE_SHIFT) > end_pfn) | ||
201 | end_pfn = end >> PAGE_SHIFT; | ||
202 | return 1; | ||
203 | } | ||
204 | |||
205 | static inline int save_add_info(void) | ||
206 | { | ||
207 | return hotadd_percent > 0; | ||
208 | } | ||
209 | #else | ||
210 | int update_end_of_memory(unsigned long end) {return -1;} | 154 | int update_end_of_memory(unsigned long end) {return -1;} |
211 | static int hotadd_enough_memory(struct bootnode *nd) {return 1;} | 155 | static int hotadd_enough_memory(struct bootnode *nd) {return 1;} |
212 | #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE | 156 | #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE |
@@ -214,7 +158,6 @@ static inline int save_add_info(void) {return 1;} | |||
214 | #else | 158 | #else |
215 | static inline int save_add_info(void) {return 0;} | 159 | static inline int save_add_info(void) {return 0;} |
216 | #endif | 160 | #endif |
217 | #endif | ||
218 | /* | 161 | /* |
219 | * Update nodes_add and decide if to include add are in the zone. | 162 | * Update nodes_add and decide if to include add are in the zone. |
220 | * Both SPARSE and RESERVE need nodes_add infomation. | 163 | * Both SPARSE and RESERVE need nodes_add infomation. |