diff options
author | Fenkart/Bostandzhyan <andreas.fenkart@streamunlimited.com> | 2010-02-07 15:45:47 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-02-15 16:40:32 -0500 |
commit | db9ef1af4879c121c354ad2f653f185f1d50fd89 (patch) | |
tree | 0207d586310e601c7d4666ec84b65f46266e9d50 /arch/arm/mm | |
parent | 22192b37bbeec5d850c233491f3cb7610363ce34 (diff) |
ARM: 5926/1: Add "Virtual kernel memory..." printout.
Code based on parisc and x86_32.
Tested-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/init.c | 78 |
1 files changed, 69 insertions, 9 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index a340569b991e..e8e3a74ac5b5 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <asm/setup.h> | 23 | #include <asm/setup.h> |
24 | #include <asm/sizes.h> | 24 | #include <asm/sizes.h> |
25 | #include <asm/tlb.h> | 25 | #include <asm/tlb.h> |
26 | #include <asm/fixmap.h> | ||
26 | 27 | ||
27 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
28 | #include <asm/mach/map.h> | 29 | #include <asm/mach/map.h> |
@@ -562,7 +563,7 @@ static void __init free_unused_memmap_node(int node, struct meminfo *mi) | |||
562 | */ | 563 | */ |
563 | void __init mem_init(void) | 564 | void __init mem_init(void) |
564 | { | 565 | { |
565 | unsigned int codesize, datasize, initsize; | 566 | unsigned long reserved_pages, free_pages; |
566 | int i, node; | 567 | int i, node; |
567 | 568 | ||
568 | #ifndef CONFIG_DISCONTIGMEM | 569 | #ifndef CONFIG_DISCONTIGMEM |
@@ -598,6 +599,33 @@ void __init mem_init(void) | |||
598 | totalram_pages += totalhigh_pages; | 599 | totalram_pages += totalhigh_pages; |
599 | #endif | 600 | #endif |
600 | 601 | ||
602 | reserved_pages = free_pages = 0; | ||
603 | |||
604 | for_each_online_node(node) { | ||
605 | pg_data_t *n = NODE_DATA(node); | ||
606 | struct page *map = pgdat_page_nr(n, 0) - n->node_start_pfn; | ||
607 | |||
608 | for_each_nodebank(i, &meminfo, node) { | ||
609 | struct membank *bank = &meminfo.bank[i]; | ||
610 | unsigned int pfn1, pfn2; | ||
611 | struct page *page, *end; | ||
612 | |||
613 | pfn1 = bank_pfn_start(bank); | ||
614 | pfn2 = bank_pfn_end(bank); | ||
615 | |||
616 | page = map + pfn1; | ||
617 | end = map + pfn2; | ||
618 | |||
619 | do { | ||
620 | if (PageReserved(page)) | ||
621 | reserved_pages++; | ||
622 | else if (!page_count(page)) | ||
623 | free_pages++; | ||
624 | page++; | ||
625 | } while (page < end); | ||
626 | } | ||
627 | } | ||
628 | |||
601 | /* | 629 | /* |
602 | * Since our memory may not be contiguous, calculate the | 630 | * Since our memory may not be contiguous, calculate the |
603 | * real number of pages we have in this system | 631 | * real number of pages we have in this system |
@@ -610,16 +638,48 @@ void __init mem_init(void) | |||
610 | } | 638 | } |
611 | printk(" = %luMB total\n", num_physpages >> (20 - PAGE_SHIFT)); | 639 | printk(" = %luMB total\n", num_physpages >> (20 - PAGE_SHIFT)); |
612 | 640 | ||
613 | codesize = _etext - _text; | 641 | printk(KERN_NOTICE "Memory: %luk/%luk available, %luk reserved, %luK highmem\n", |
614 | datasize = _end - _data; | 642 | nr_free_pages() << (PAGE_SHIFT-10), |
615 | initsize = __init_end - __init_begin; | 643 | free_pages << (PAGE_SHIFT-10), |
616 | 644 | reserved_pages << (PAGE_SHIFT-10), | |
617 | printk(KERN_NOTICE "Memory: %luKB available (%dK code, " | ||
618 | "%dK data, %dK init, %luK highmem)\n", | ||
619 | nr_free_pages() << (PAGE_SHIFT-10), codesize >> 10, | ||
620 | datasize >> 10, initsize >> 10, | ||
621 | totalhigh_pages << (PAGE_SHIFT-10)); | 645 | totalhigh_pages << (PAGE_SHIFT-10)); |
622 | 646 | ||
647 | #define MLK(b, t) b, t, ((t) - (b)) >> 10 | ||
648 | #define MLM(b, t) b, t, ((t) - (b)) >> 20 | ||
649 | #define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), SZ_1K) | ||
650 | |||
651 | printk(KERN_NOTICE "Virtual kernel memory layout:\n" | ||
652 | " vector : 0x%08lx - 0x%08lx (%4ld kB)\n" | ||
653 | " fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n" | ||
654 | " vmalloc : 0x%08lx - 0x%08lx (%4ld MB)\n" | ||
655 | " lowmem : 0x%08lx - 0x%08lx (%4ld MB)\n" | ||
656 | #ifdef CONFIG_HIGHMEM | ||
657 | " pkmap : 0x%08lx - 0x%08lx (%4ld MB)\n" | ||
658 | #endif | ||
659 | " modules : 0x%08lx - 0x%08lx (%4ld MB)\n" | ||
660 | " .init : 0x%p" " - 0x%p" " (%4d kB)\n" | ||
661 | " .text : 0x%p" " - 0x%p" " (%4d kB)\n" | ||
662 | " .data : 0x%p" " - 0x%p" " (%4d kB)\n", | ||
663 | |||
664 | MLK(UL(CONFIG_VECTORS_BASE), UL(CONFIG_VECTORS_BASE) + | ||
665 | (PAGE_SIZE)), | ||
666 | MLK(FIXADDR_START, FIXADDR_TOP), | ||
667 | MLM(VMALLOC_START, (unsigned long)VMALLOC_END), | ||
668 | MLM(PAGE_OFFSET, (unsigned long)high_memory), | ||
669 | #ifdef CONFIG_HIGHMEM | ||
670 | MLM(PKMAP_BASE, (PKMAP_BASE) + (LAST_PKMAP) * | ||
671 | (PAGE_SIZE)), | ||
672 | #endif | ||
673 | MLM(MODULES_VADDR, MODULES_END), | ||
674 | |||
675 | MLK_ROUNDUP(__init_begin, __init_end), | ||
676 | MLK_ROUNDUP(_text, _etext), | ||
677 | MLK_ROUNDUP(_data, _edata)); | ||
678 | |||
679 | #undef MLK | ||
680 | #undef MLM | ||
681 | #undef MLK_ROUNDUP | ||
682 | |||
623 | if (PAGE_SIZE >= 16384 && num_physpages <= 128) { | 683 | if (PAGE_SIZE >= 16384 && num_physpages <= 128) { |
624 | extern int sysctl_overcommit_memory; | 684 | extern int sysctl_overcommit_memory; |
625 | /* | 685 | /* |