diff options
author | Jiang Liu <liuj97@gmail.com> | 2013-07-03 18:03:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 19:07:35 -0400 |
commit | d385d9ee7add81254cb7094d616138089ea500f5 (patch) | |
tree | 1e9d2ae16a2562811028c4c74649364574004d4b | |
parent | e461d627d5c0957457eb354843f3c29b50646d63 (diff) |
mm/alpha: prepare for removing num_physpages and simplify mem_init()
Prepare for removing num_physpages and simplify mem_init().
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/alpha/mm/init.c | 32 | ||||
-rw-r--r-- | arch/alpha/mm/numa.c | 34 |
2 files changed, 4 insertions, 62 deletions
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c index eee47a453d7d..af91010990b0 100644 --- a/arch/alpha/mm/init.c +++ b/arch/alpha/mm/init.c | |||
@@ -277,42 +277,14 @@ srm_paging_stop (void) | |||
277 | #endif | 277 | #endif |
278 | 278 | ||
279 | #ifndef CONFIG_DISCONTIGMEM | 279 | #ifndef CONFIG_DISCONTIGMEM |
280 | static void __init | ||
281 | printk_memory_info(void) | ||
282 | { | ||
283 | unsigned long codesize, reservedpages, datasize, initsize, tmp; | ||
284 | extern int page_is_ram(unsigned long) __init; | ||
285 | |||
286 | /* printk all informations */ | ||
287 | reservedpages = 0; | ||
288 | for (tmp = 0; tmp < max_low_pfn; tmp++) | ||
289 | /* | ||
290 | * Only count reserved RAM pages | ||
291 | */ | ||
292 | if (page_is_ram(tmp) && PageReserved(mem_map+tmp)) | ||
293 | reservedpages++; | ||
294 | |||
295 | codesize = (unsigned long) &_etext - (unsigned long) &_text; | ||
296 | datasize = (unsigned long) &_edata - (unsigned long) &_data; | ||
297 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; | ||
298 | |||
299 | printk("Memory: %luk/%luk available (%luk kernel code, %luk reserved, %luk data, %luk init)\n", | ||
300 | nr_free_pages() << (PAGE_SHIFT-10), | ||
301 | max_mapnr << (PAGE_SHIFT-10), | ||
302 | codesize >> 10, | ||
303 | reservedpages << (PAGE_SHIFT-10), | ||
304 | datasize >> 10, | ||
305 | initsize >> 10); | ||
306 | } | ||
307 | |||
308 | void __init | 280 | void __init |
309 | mem_init(void) | 281 | mem_init(void) |
310 | { | 282 | { |
311 | max_mapnr = num_physpages = max_low_pfn; | 283 | max_mapnr = max_low_pfn; |
312 | free_all_bootmem(); | 284 | free_all_bootmem(); |
313 | high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); | 285 | high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); |
314 | 286 | ||
315 | printk_memory_info(); | 287 | mem_init_print_info(NULL); |
316 | } | 288 | } |
317 | #endif /* CONFIG_DISCONTIGMEM */ | 289 | #endif /* CONFIG_DISCONTIGMEM */ |
318 | 290 | ||
diff --git a/arch/alpha/mm/numa.c b/arch/alpha/mm/numa.c index 857452c13c4d..0894b3a8b70f 100644 --- a/arch/alpha/mm/numa.c +++ b/arch/alpha/mm/numa.c | |||
@@ -129,8 +129,6 @@ setup_memory_node(int nid, void *kernel_end) | |||
129 | if (node_max_pfn > max_low_pfn) | 129 | if (node_max_pfn > max_low_pfn) |
130 | max_pfn = max_low_pfn = node_max_pfn; | 130 | max_pfn = max_low_pfn = node_max_pfn; |
131 | 131 | ||
132 | num_physpages += node_max_pfn - node_min_pfn; | ||
133 | |||
134 | #if 0 /* we'll try this one again in a little while */ | 132 | #if 0 /* we'll try this one again in a little while */ |
135 | /* Cute trick to make sure our local node data is on local memory */ | 133 | /* Cute trick to make sure our local node data is on local memory */ |
136 | node_data[nid] = (pg_data_t *)(__va(node_min_pfn << PAGE_SHIFT)); | 134 | node_data[nid] = (pg_data_t *)(__va(node_min_pfn << PAGE_SHIFT)); |
@@ -324,37 +322,9 @@ void __init paging_init(void) | |||
324 | 322 | ||
325 | void __init mem_init(void) | 323 | void __init mem_init(void) |
326 | { | 324 | { |
327 | unsigned long codesize, reservedpages, datasize, initsize, pfn; | ||
328 | extern int page_is_ram(unsigned long) __init; | ||
329 | unsigned long nid, i; | ||
330 | high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); | 325 | high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); |
331 | 326 | free_all_bootmem(); | |
332 | reservedpages = 0; | 327 | mem_init_print_info(NULL); |
333 | for_each_online_node(nid) { | ||
334 | /* | ||
335 | * This will free up the bootmem, ie, slot 0 memory | ||
336 | */ | ||
337 | free_all_bootmem_node(NODE_DATA(nid)); | ||
338 | |||
339 | pfn = NODE_DATA(nid)->node_start_pfn; | ||
340 | for (i = 0; i < node_spanned_pages(nid); i++, pfn++) | ||
341 | if (page_is_ram(pfn) && | ||
342 | PageReserved(nid_page_nr(nid, i))) | ||
343 | reservedpages++; | ||
344 | } | ||
345 | |||
346 | codesize = (unsigned long) &_etext - (unsigned long) &_text; | ||
347 | datasize = (unsigned long) &_edata - (unsigned long) &_data; | ||
348 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; | ||
349 | |||
350 | printk("Memory: %luk/%luk available (%luk kernel code, %luk reserved, " | ||
351 | "%luk data, %luk init)\n", | ||
352 | nr_free_pages() << (PAGE_SHIFT-10), | ||
353 | num_physpages << (PAGE_SHIFT-10), | ||
354 | codesize >> 10, | ||
355 | reservedpages << (PAGE_SHIFT-10), | ||
356 | datasize >> 10, | ||
357 | initsize >> 10); | ||
358 | #if 0 | 328 | #if 0 |
359 | mem_stress(); | 329 | mem_stress(); |
360 | #endif | 330 | #endif |