Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1544294 > unrolled thread

[PATCH 12/21] MIPS memblock: Add memblock print outs in debug

Started bySerge Semin <fancer.lancer@gmail.com>
First post2016-12-19 03:20 +0100
Last post2016-12-19 03:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 12/21] MIPS memblock: Add memblock print outs in debug Serge Semin <fancer.lancer@gmail.com> - 2016-12-19 03:20 +0100

#1544294 — [PATCH 12/21] MIPS memblock: Add memblock print outs in debug

FromSerge Semin <fancer.lancer@gmail.com>
Date2016-12-19 03:20 +0100
Subject[PATCH 12/21] MIPS memblock: Add memblock print outs in debug
Message-ID<sPVIu-1Cr-29@gated-at.bofh.it>
When debugging it is useful to have a list of all memory regions
added and reserved in the system. Ones are printed right from
memblock if memblock_debug is enabled.

Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
---
 arch/mips/kernel/setup.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index d2f410d..409d23d 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -200,11 +200,16 @@ void __init detect_memory_region(phys_addr_t start, phys_addr_t sz_min, phys_add
 	add_memory_region(start, size, BOOT_MEM_RAM);
 }
 
+/*
+ * Print declared memory layout
+ */
 static void __init print_memory_map(void)
 {
 	int i;
 	const int field = 2 * sizeof(unsigned long);
 
+	/* Print the added memory map  */
+	pr_info("Determined physical RAM map:\n");
 	for (i = 0; i < boot_mem_map.nr_map; i++) {
 		printk(KERN_INFO " memory: %0*Lx @ %0*Lx ",
 		       field, (unsigned long long) boot_mem_map.map[i].size,
@@ -228,6 +233,9 @@ static void __init print_memory_map(void)
 			break;
 		}
 	}
+
+	/* Print memblocks if memblock_debug is set */
+	memblock_dump_all();
 }
 
 /*
@@ -795,11 +803,11 @@ static void __init arch_mem_init(char **cmdline_p)
 	/* Sanity check the specified memory */
 	sanity_check_meminfo();
 
-	pr_info("Determined physical RAM map:\n");
-	print_memory_map();
-
 	bootmem_init();
 
+	/* Print memory map initialized by arch-specific code and params */
+	print_memory_map();
+
 	device_tree_init();
 	sparse_init();
 	plat_swiotlb_setup();
-- 
2.6.6

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web