summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/memblock.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/mm/memblock.c b/mm/memblock.c
index 9e28c1286ec6..c5c80d9bcea3 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -2158,12 +2158,19 @@ void __init memblock_free_all(void)
}
#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_ARCH_KEEP_MEMBLOCK)
+static const char * const flagname[] = {
+ [ilog2(MEMBLOCK_HOTPLUG)] = "HOTPLUG",
+ [ilog2(MEMBLOCK_MIRROR)] = "MIRROR",
+ [ilog2(MEMBLOCK_NOMAP)] = "NOMAP",
+ [ilog2(MEMBLOCK_DRIVER_MANAGED)] = "DRV_MNG",
+};
static int memblock_debug_show(struct seq_file *m, void *private)
{
struct memblock_type *type = m->private;
struct memblock_region *reg;
- int i;
+ int i, j;
+ unsigned int count = ARRAY_SIZE(flagname);
phys_addr_t end;
for (i = 0; i < type->cnt; i++) {
@@ -2171,7 +2178,20 @@ static int memblock_debug_show(struct seq_file *m, void *private)
end = reg->base + reg->size - 1;
seq_printf(m, "%4d: ", i);
- seq_printf(m, "%pa..%pa\n", &reg->base, &end);
+ seq_printf(m, "%pa..%pa ", &reg->base, &end);
+ seq_printf(m, "%4d ", memblock_get_region_node(reg));
+ if (reg->flags) {
+ for (j = 0; j < count; j++) {
+ if (reg->flags & (1U << j)) {
+ seq_printf(m, "%s\n", flagname[j]);
+ break;
+ }
+ }
+ if (j == count)
+ seq_printf(m, "%s\n", "UNKNOWN");
+ } else {
+ seq_printf(m, "%s\n", "NONE");
+ }
}
return 0;
}