ARM: mm: Update the kernel log messages
After reclaiming vmalloc and adjusting lowmem, the two regions are no longer contiguous. Update the messages printed during bootup to list all regions corresponding to low memory and vmalloc respectively. Change-Id: Ib3e25b530b3dfbd1f9796cdc580fb79da484e850 Signed-off-by: Susheel Khiani <skhiani@codeaurora.org>
This commit is contained in:
parent
fbcc212e73
commit
ed6ef4b170
2 changed files with 78 additions and 24 deletions
|
@ -466,6 +466,54 @@ static void __init free_highpages(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
#define MLK(b, t) (b), (t), (((t) - (b)) >> 10)
|
||||
#define MLM(b, t) (b), (t), (((t) - (b)) >> 20)
|
||||
#define MLK_ROUNDUP(b, t) (b), (t), (DIV_ROUND_UP(((t) - (b)), SZ_1K))
|
||||
|
||||
#ifdef CONFIG_ENABLE_VMALLOC_SAVING
|
||||
static void print_vmalloc_lowmem_info(void)
|
||||
{
|
||||
struct memblock_region *reg, *prev_reg = NULL;
|
||||
|
||||
pr_notice(
|
||||
" vmalloc : 0x%08lx - 0x%08lx (%4ld MB)\n",
|
||||
MLM((unsigned long)high_memory, VMALLOC_END));
|
||||
|
||||
for_each_memblock_rev(memory, reg) {
|
||||
phys_addr_t start_phys = reg->base;
|
||||
phys_addr_t end_phys = reg->base + reg->size;
|
||||
|
||||
if (start_phys > arm_lowmem_limit)
|
||||
continue;
|
||||
|
||||
if (end_phys > arm_lowmem_limit)
|
||||
end_phys = arm_lowmem_limit;
|
||||
|
||||
if (prev_reg == NULL) {
|
||||
prev_reg = reg;
|
||||
|
||||
pr_notice(
|
||||
" lowmem : 0x%08lx - 0x%08lx (%4ld MB)\n",
|
||||
MLM((unsigned long)__va(start_phys),
|
||||
(unsigned long)__va(end_phys)));
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
pr_notice(
|
||||
" vmalloc : 0x%08lx - 0x%08lx (%4ld MB)\n",
|
||||
MLM((unsigned long)__va(end_phys),
|
||||
(unsigned long)__va(prev_reg->base)));
|
||||
|
||||
|
||||
pr_notice(
|
||||
" lowmem : 0x%08lx - 0x%08lx (%4ld MB)\n",
|
||||
MLM((unsigned long)__va(start_phys),
|
||||
(unsigned long)__va(end_phys)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* mem_init() marks the free areas in the mem_map and tells us how much
|
||||
* memory is free. This is done after various parts of the system have
|
||||
|
@ -494,39 +542,40 @@ void __init mem_init(void)
|
|||
|
||||
mem_init_print_info(NULL);
|
||||
|
||||
#define MLK(b, t) b, t, ((t) - (b)) >> 10
|
||||
#define MLM(b, t) b, t, ((t) - (b)) >> 20
|
||||
#define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), SZ_1K)
|
||||
|
||||
pr_notice("Virtual kernel memory layout:\n"
|
||||
" vector : 0x%08lx - 0x%08lx (%4ld kB)\n"
|
||||
#ifdef CONFIG_HAVE_TCM
|
||||
" DTCM : 0x%08lx - 0x%08lx (%4ld kB)\n"
|
||||
" ITCM : 0x%08lx - 0x%08lx (%4ld kB)\n"
|
||||
#endif
|
||||
" fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n"
|
||||
" vmalloc : 0x%08lx - 0x%08lx (%4ld MB)\n"
|
||||
" lowmem : 0x%08lx - 0x%08lx (%4ld MB)\n"
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
" pkmap : 0x%08lx - 0x%08lx (%4ld MB)\n"
|
||||
#endif
|
||||
#ifdef CONFIG_MODULES
|
||||
" modules : 0x%08lx - 0x%08lx (%4ld MB)\n"
|
||||
#endif
|
||||
" .text : 0x%p" " - 0x%p" " (%4td kB)\n"
|
||||
" .init : 0x%p" " - 0x%p" " (%4td kB)\n"
|
||||
" .data : 0x%p" " - 0x%p" " (%4td kB)\n"
|
||||
" .bss : 0x%p" " - 0x%p" " (%4td kB)\n",
|
||||
|
||||
" fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n",
|
||||
MLK(UL(CONFIG_VECTORS_BASE), UL(CONFIG_VECTORS_BASE) +
|
||||
(PAGE_SIZE)),
|
||||
#ifdef CONFIG_HAVE_TCM
|
||||
MLK(DTCM_OFFSET, (unsigned long) dtcm_end),
|
||||
MLK(ITCM_OFFSET, (unsigned long) itcm_end),
|
||||
#endif
|
||||
MLK(FIXADDR_START, FIXADDR_END),
|
||||
MLK(FIXADDR_START, FIXADDR_END));
|
||||
#ifdef CONFIG_ENABLE_VMALLOC_SAVING
|
||||
print_vmalloc_lowmem_info();
|
||||
#else
|
||||
printk(KERN_NOTICE
|
||||
" vmalloc : 0x%08lx - 0x%08lx (%4ld MB)\n"
|
||||
" lowmem : 0x%08lx - 0x%08lx (%4ld MB)\n",
|
||||
MLM(VMALLOC_START, VMALLOC_END),
|
||||
MLM(PAGE_OFFSET, (unsigned long)high_memory),
|
||||
MLM(PAGE_OFFSET, (unsigned long)high_memory));
|
||||
#endif
|
||||
printk(KERN_NOTICE
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
" pkmap : 0x%08lx - 0x%08lx (%4ld MB)\n"
|
||||
#endif
|
||||
#ifdef CONFIG_MODULES
|
||||
" modules : 0x%08lx - 0x%08lx (%4ld MB)\n"
|
||||
#endif
|
||||
" .text : 0x%p" " - 0x%p" " (%4d kB)\n"
|
||||
" .init : 0x%p" " - 0x%p" " (%4d kB)\n"
|
||||
" .data : 0x%p" " - 0x%p" " (%4d kB)\n"
|
||||
" .bss : 0x%p" " - 0x%p" " (%4d kB)\n",
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
MLM(PKMAP_BASE, (PKMAP_BASE) + (LAST_PKMAP) *
|
||||
(PAGE_SIZE)),
|
||||
|
@ -540,10 +589,6 @@ void __init mem_init(void)
|
|||
MLK_ROUNDUP(_sdata, _edata),
|
||||
MLK_ROUNDUP(__bss_start, __bss_stop));
|
||||
|
||||
#undef MLK
|
||||
#undef MLM
|
||||
#undef MLK_ROUNDUP
|
||||
|
||||
/*
|
||||
* Check boundaries twice: Some fundamental inconsistencies can
|
||||
* be detected at build time already.
|
||||
|
@ -569,6 +614,10 @@ void __init mem_init(void)
|
|||
}
|
||||
}
|
||||
|
||||
#undef MLK
|
||||
#undef MLM
|
||||
#undef MLK_ROUNDUP
|
||||
|
||||
#ifdef CONFIG_ARM_KERNMEM_PERMS
|
||||
struct section_perm {
|
||||
unsigned long start;
|
||||
|
|
|
@ -394,6 +394,11 @@ static inline unsigned long memblock_region_reserved_end_pfn(const struct memblo
|
|||
region < (memblock.memblock_type.regions + memblock.memblock_type.cnt); \
|
||||
region++)
|
||||
|
||||
#define for_each_memblock_rev(memblock_type, region) \
|
||||
for (region = memblock.memblock_type.regions + \
|
||||
memblock.memblock_type.cnt - 1; \
|
||||
region >= memblock.memblock_type.regions; \
|
||||
region--)
|
||||
|
||||
#ifdef CONFIG_ARCH_DISCARD_MEMBLOCK
|
||||
#define __init_memblock __meminit
|
||||
|
|
Loading…
Add table
Reference in a new issue