summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2010-08-25 13:39:17 -0700
committerH. Peter Anvin <hpa@zytor.com>2010-08-27 11:11:35 -0700
commit301ff3e88ef9ff4bdb92f36a3e6170fce4c9dd34 (patch)
treec5076ba395e8281d4526065288aa81dac0597e3b
parente82d42be24bd5d75bf6f81045636e6ca95ab55f2 (diff)
x86, memblock: Use memblock_debug to control debug message print out
Also let memblock_x86_reserve_range/memblock_x86_free_range could print out name if memblock=debug is specified will also print ther name when reserve_memblock_area/free_memblock_area are called. -v2: according to Ingo, put " if (memblock_debug) " in one place Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--arch/x86/mm/memblock.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/arch/x86/mm/memblock.c b/arch/x86/mm/memblock.c
index 32ddad5dc93..aaff3932588 100644
--- a/arch/x86/mm/memblock.c
+++ b/arch/x86/mm/memblock.c
@@ -118,10 +118,10 @@ static void __init memblock_x86_subtract_reserved(struct range *range, int az)
/* Take out region array itself at first*/
memblock_free_reserved_regions();
- pr_info("Subtract (%ld early reservations)\n", memblock.reserved.cnt);
+ memblock_dbg("Subtract (%ld early reservations)\n", memblock.reserved.cnt);
for_each_memblock(reserved, r) {
- pr_info(" [%010llx-%010llx]\n", (u64)r->base, (u64)r->base + r->size - 1);
+ memblock_dbg(" [%010llx-%010llx]\n", (u64)r->base, (u64)r->base + r->size - 1);
final_start = PFN_DOWN(r->base);
final_end = PFN_UP(r->base + r->size);
if (final_start >= final_end)
@@ -193,16 +193,16 @@ void __init memblock_x86_to_bootmem(u64 start, u64 end)
memblock_free_reserved_regions();
count = memblock.reserved.cnt;
- pr_info("(%d early reservations) ==> bootmem [%010llx-%010llx]\n", count, start, end - 1);
+ memblock_dbg("(%d early reservations) ==> bootmem [%#010llx-%#010llx]\n", count, start, end - 1);
for_each_memblock(reserved, r) {
- pr_info(" [%010llx-%010llx] ", (u64)r->base, (u64)r->base + r->size - 1);
+ memblock_dbg(" [%#010llx-%#010llx] ", (u64)r->base, (u64)r->base + r->size - 1);
final_start = max(start, r->base);
final_end = min(end, r->base + r->size);
if (final_start >= final_end) {
- pr_cont("\n");
+ memblock_dbg("\n");
continue;
}
- pr_cont(" ==> [%010llx-%010llx]\n", final_start, final_end - 1);
+ memblock_dbg(" ==> [%#010llx-%#010llx]\n", final_start, final_end - 1);
reserve_bootmem_generic(final_start, final_end - final_start, BOOTMEM_DEFAULT);
}
@@ -280,9 +280,11 @@ void __init memblock_x86_reserve_range(u64 start, u64 end, char *name)
if (start == end)
return;
- if (WARN_ONCE(start > end, "memblock_x86_reserve_range: wrong range [%#llx, %#llx]\n", start, end))
+ if (WARN_ONCE(start > end, "memblock_x86_reserve_range: wrong range [%#llx, %#llx)\n", start, end))
return;
+ memblock_dbg(" memblock_x86_reserve_range: [%#010llx-%#010llx] %16s\n", start, end - 1, name);
+
memblock_reserve(start, end - start);
}
@@ -291,9 +293,11 @@ void __init memblock_x86_free_range(u64 start, u64 end)
if (start == end)
return;
- if (WARN_ONCE(start > end, "memblock_x86_free_range: wrong range [%#llx, %#llx]\n", start, end))
+ if (WARN_ONCE(start > end, "memblock_x86_free_range: wrong range [%#llx, %#llx)\n", start, end))
return;
+ memblock_dbg(" memblock_x86_free_range: [%#010llx-%#010llx]\n", start, end - 1);
+
memblock_free(start, end - start);
}