Commit 11a6b0c9 authored by Yinghai Lu's avatar Yinghai Lu Committed by Ingo Molnar

x86: 64 bit print out absent pages num too

so users are not confused with memhole causing big total ram

we don't need to worry about 32 bit, because memhole is always
above max_low_pfn.
Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent e7706fc6
...@@ -884,6 +884,7 @@ static struct kcore_list kcore_mem, kcore_vmalloc, kcore_kernel, ...@@ -884,6 +884,7 @@ static struct kcore_list kcore_mem, kcore_vmalloc, kcore_kernel,
void __init mem_init(void) void __init mem_init(void)
{ {
long codesize, reservedpages, datasize, initsize; long codesize, reservedpages, datasize, initsize;
unsigned long absent_pages;
start_periodic_check_for_corruption(); start_periodic_check_for_corruption();
...@@ -899,8 +900,9 @@ void __init mem_init(void) ...@@ -899,8 +900,9 @@ void __init mem_init(void)
#else #else
totalram_pages = free_all_bootmem(); totalram_pages = free_all_bootmem();
#endif #endif
reservedpages = max_pfn - totalram_pages -
absent_pages_in_range(0, max_pfn); absent_pages = absent_pages_in_range(0, max_pfn);
reservedpages = max_pfn - totalram_pages - absent_pages;
after_bootmem = 1; after_bootmem = 1;
codesize = (unsigned long) &_etext - (unsigned long) &_text; codesize = (unsigned long) &_etext - (unsigned long) &_text;
...@@ -917,10 +919,11 @@ void __init mem_init(void) ...@@ -917,10 +919,11 @@ void __init mem_init(void)
VSYSCALL_END - VSYSCALL_START); VSYSCALL_END - VSYSCALL_START);
printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, "
"%ldk reserved, %ldk data, %ldk init)\n", "%ldk absent, %ldk reserved, %ldk data, %ldk init)\n",
(unsigned long) nr_free_pages() << (PAGE_SHIFT-10), (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
max_pfn << (PAGE_SHIFT-10), max_pfn << (PAGE_SHIFT-10),
codesize >> 10, codesize >> 10,
absent_pages << (PAGE_SHIFT-10),
reservedpages << (PAGE_SHIFT-10), reservedpages << (PAGE_SHIFT-10),
datasize >> 10, datasize >> 10,
initsize >> 10); initsize >> 10);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment