diff options
| author | Mel Gorman <mgorman@suse.de> | 2014-01-21 18:49:13 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-21 19:19:44 -0500 |
| commit | aec6a8889a98a0cd58357cd0937a25189908f191 (patch) | |
| tree | 4c0bd0fa7a3d9e6edc0f863782e1d5807ebefb12 | |
| parent | ece86e222db48d04bda218a2be70e384518bb08c (diff) | |
mm, show_mem: remove SHOW_MEM_FILTER_PAGE_COUNT
Commit 4b59e6c47309 ("mm, show_mem: suppress page counts in
non-blockable contexts") introduced SHOW_MEM_FILTER_PAGE_COUNT to
suppress PFN walks on large memory machines. Commit c78e93630d15 ("mm:
do not walk all of system memory during show_mem") avoided a PFN walk in
the generic show_mem helper which removes the requirement for
SHOW_MEM_FILTER_PAGE_COUNT in that case.
This patch removes PFN walkers from the arch-specific implementations
that report on a per-node or per-zone granularity. ARM and unicore32
still do a PFN walk as they report memory usage on each bank which is a
much finer granularity where the debugging information may still be of
use. As the remaining arches doing PFN walks have relatively small
amounts of memory, this patch simply removes SHOW_MEM_FILTER_PAGE_COUNT.
[akpm@linux-foundation.org: fix parisc]
Signed-off-by: Mel Gorman <mgorman@suse.de>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: James Bottomley <jejb@parisc-linux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| -rw-r--r-- | arch/arm/mm/init.c | 3 | ||||
| -rw-r--r-- | arch/ia64/mm/contig.c | 68 | ||||
| -rw-r--r-- | arch/ia64/mm/discontig.c | 63 | ||||
| -rw-r--r-- | arch/ia64/mm/init.c | 48 | ||||
| -rw-r--r-- | arch/parisc/mm/init.c | 59 | ||||
| -rw-r--r-- | arch/unicore32/mm/init.c | 3 | ||||
| -rw-r--r-- | include/linux/mm.h | 1 | ||||
| -rw-r--r-- | lib/show_mem.c | 3 | ||||
| -rw-r--r-- | mm/page_alloc.c | 7 |
9 files changed, 65 insertions, 190 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 3e8f106ee5fe..2e71e245df90 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
| @@ -92,9 +92,6 @@ void show_mem(unsigned int filter) | |||
| 92 | printk("Mem-info:\n"); | 92 | printk("Mem-info:\n"); |
| 93 | show_free_areas(filter); | 93 | show_free_areas(filter); |
| 94 | 94 | ||
| 95 | if (filter & SHOW_MEM_FILTER_PAGE_COUNT) | ||
| 96 | return; | ||
| 97 | |||
| 98 | for_each_bank (i, mi) { | 95 | for_each_bank (i, mi) { |
| 99 | struct membank *bank = &mi->bank[i]; | 96 | struct membank *bank = &mi->bank[i]; |
| 100 | unsigned int pfn1, pfn2; | 97 | unsigned int pfn1, pfn2; |
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c index da5237d636d6..52715a71aede 100644 --- a/arch/ia64/mm/contig.c +++ b/arch/ia64/mm/contig.c | |||
| @@ -31,74 +31,6 @@ | |||
| 31 | static unsigned long max_gap; | 31 | static unsigned long max_gap; |
| 32 | #endif | 32 | #endif |
| 33 | 33 | ||
| 34 | /** | ||
| 35 | * show_mem - give short summary of memory stats | ||
| 36 | * | ||
| 37 | * Shows a simple page count of reserved and used pages in the system. | ||
| 38 | * For discontig machines, it does this on a per-pgdat basis. | ||
| 39 | */ | ||
| 40 | void show_mem(unsigned int filter) | ||
| 41 | { | ||
| 42 | int i, total_reserved = 0; | ||
| 43 | int total_shared = 0, total_cached = 0; | ||
| 44 | unsigned long total_present = 0; | ||
| 45 | pg_data_t *pgdat; | ||
| 46 | |||
| 47 | printk(KERN_INFO "Mem-info:\n"); | ||
| 48 | show_free_areas(filter); | ||
| 49 | printk(KERN_INFO "Node memory in pages:\n"); | ||
| 50 | if (filter & SHOW_MEM_FILTER_PAGE_COUNT) | ||
| 51 | return; | ||
| 52 | for_each_online_pgdat(pgdat) { | ||
| 53 | unsigned long present; | ||
| 54 | unsigned long flags; | ||
| 55 | int shared = 0, cached = 0, reserved = 0; | ||
| 56 | int nid = pgdat->node_id; | ||
| 57 | |||
| 58 | if (skip_free_areas_node(filter, nid)) | ||
| 59 | continue; | ||
| 60 | pgdat_resize_lock(pgdat, &flags); | ||
| 61 | present = pgdat->node_present_pages; | ||
| 62 | for(i = 0; i < pgdat->node_spanned_pages; i++) { | ||
| 63 | struct page *page; | ||
| 64 | if (unlikely(i % MAX_ORDER_NR_PAGES == 0)) | ||
| 65 | touch_nmi_watchdog(); | ||
| 66 | if (pfn_valid(pgdat->node_start_pfn + i)) | ||
| 67 | page = pfn_to_page(pgdat->node_start_pfn + i); | ||
| 68 | else { | ||
| 69 | #ifdef CONFIG_VIRTUAL_MEM_MAP | ||
| 70 | if (max_gap < LARGE_GAP) | ||
| 71 | continue; | ||
| 72 | #endif | ||
| 73 | i = vmemmap_find_next_valid_pfn(nid, i) - 1; | ||
| 74 | continue; | ||
| 75 | } | ||
| 76 | if (PageReserved(page)) | ||
| 77 | reserved++; | ||
| 78 | else if (PageSwapCache(page)) | ||
| 79 | cached++; | ||
| 80 | else if (page_count(page)) | ||
| 81 | shared += page_count(page)-1; | ||
| 82 | } | ||
| 83 | pgdat_resize_unlock(pgdat, &flags); | ||
| 84 | total_present += present; | ||
| 85 | total_reserved += reserved; | ||
| 86 | total_cached += cached; | ||
| 87 | total_shared += shared; | ||
| 88 | printk(KERN_INFO "Node %4d: RAM: %11ld, rsvd: %8d, " | ||
| 89 | "shrd: %10d, swpd: %10d\n", nid, | ||
| 90 | present, reserved, shared, cached); | ||
| 91 | } | ||
| 92 | printk(KERN_INFO "%ld pages of RAM\n", total_present); | ||
| 93 | printk(KERN_INFO "%d reserved pages\n", total_reserved); | ||
| 94 | printk(KERN_INFO "%d pages shared\n", total_shared); | ||
| 95 | printk(KERN_INFO "%d pages swap cached\n", total_cached); | ||
| 96 | printk(KERN_INFO "Total of %ld pages in page table cache\n", | ||
| 97 | quicklist_total_size()); | ||
| 98 | printk(KERN_INFO "%ld free buffer pages\n", nr_free_buffer_pages()); | ||
| 99 | } | ||
| 100 | |||
| 101 | |||
| 102 | /* physical address where the bootmem map is located */ | 34 | /* physical address where the bootmem map is located */ |
| 103 | unsigned long bootmap_start; | 35 | unsigned long bootmap_start; |
| 104 | 36 | ||
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c index 2de08f4d9930..878626805369 100644 --- a/arch/ia64/mm/discontig.c +++ b/arch/ia64/mm/discontig.c | |||
| @@ -608,69 +608,6 @@ void *per_cpu_init(void) | |||
| 608 | #endif /* CONFIG_SMP */ | 608 | #endif /* CONFIG_SMP */ |
| 609 | 609 | ||
| 610 | /** | 610 | /** |
| 611 | * show_mem - give short summary of memory stats | ||
| 612 | * | ||
| 613 | * Shows a simple page count of reserved and used pages in the system. | ||
| 614 | * For discontig machines, it does this on a per-pgdat basis. | ||
| 615 | */ | ||
| 616 | void show_mem(unsigned int filter) | ||
| 617 | { | ||
| 618 | int i, total_reserved = 0; | ||
| 619 | int total_shared = 0, total_cached = 0; | ||
| 620 | unsigned long total_present = 0; | ||
| 621 | pg_data_t *pgdat; | ||
| 622 | |||
| 623 | printk(KERN_INFO "Mem-info:\n"); | ||
| 624 | show_free_areas(filter); | ||
| 625 | if (filter & SHOW_MEM_FILTER_PAGE_COUNT) | ||
| 626 | return; | ||
| 627 | printk(KERN_INFO "Node memory in pages:\n"); | ||
| 628 | for_each_online_pgdat(pgdat) { | ||
| 629 | unsigned long present; | ||
| 630 | unsigned long flags; | ||
| 631 | int shared = 0, cached = 0, reserved = 0; | ||
| 632 | int nid = pgdat->node_id; | ||
| 633 | |||
| 634 | if (skip_free_areas_node(filter, nid)) | ||
| 635 | continue; | ||
| 636 | pgdat_resize_lock(pgdat, &flags); | ||
| 637 | present = pgdat->node_present_pages; | ||
| 638 | for(i = 0; i < pgdat->node_spanned_pages; i++) { | ||
| 639 | struct page *page; | ||
| 640 | if (unlikely(i % MAX_ORDER_NR_PAGES == 0)) | ||
| 641 | touch_nmi_watchdog(); | ||
| 642 | if (pfn_valid(pgdat->node_start_pfn + i)) | ||
| 643 | page = pfn_to_page(pgdat->node_start_pfn + i); | ||
| 644 | else { | ||
| 645 | i = vmemmap_find_next_valid_pfn(nid, i) - 1; | ||
| 646 | continue; | ||
| 647 | } | ||
| 648 | if (PageReserved(page)) | ||
| 649 | reserved++; | ||
| 650 | else if (PageSwapCache(page)) | ||
| 651 | cached++; | ||
| 652 | else if (page_count(page)) | ||
| 653 | shared += page_count(page)-1; | ||
| 654 | } | ||
| 655 | pgdat_resize_unlock(pgdat, &flags); | ||
| 656 | total_present += present; | ||
| 657 | total_reserved += reserved; | ||
| 658 | total_cached += cached; | ||
| 659 | total_shared += shared; | ||
| 660 | printk(KERN_INFO "Node %4d: RAM: %11ld, rsvd: %8d, " | ||
| 661 | "shrd: %10d, swpd: %10d\n", nid, | ||
| 662 | present, reserved, shared, cached); | ||
| 663 | } | ||
| 664 | printk(KERN_INFO "%ld pages of RAM\n", total_present); | ||
| 665 | printk(KERN_INFO "%d reserved pages\n", total_reserved); | ||
| 666 | printk(KERN_INFO "%d pages shared\n", total_shared); | ||
| 667 | printk(KERN_INFO "%d pages swap cached\n", total_cached); | ||
| 668 | printk(KERN_INFO "Total of %ld pages in page table cache\n", | ||
| 669 | quicklist_total_size()); | ||
| 670 | printk(KERN_INFO "%ld free buffer pages\n", nr_free_buffer_pages()); | ||
| 671 | } | ||
| 672 | |||
| 673 | /** | ||
| 674 | * call_pernode_memory - use SRAT to call callback functions with node info | 611 | * call_pernode_memory - use SRAT to call callback functions with node info |
| 675 | * @start: physical start of range | 612 | * @start: physical start of range |
| 676 | * @len: length of range | 613 | * @len: length of range |
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index 88504abf5704..25c350264a41 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c | |||
| @@ -684,3 +684,51 @@ per_linux32_init(void) | |||
| 684 | } | 684 | } |
| 685 | 685 | ||
| 686 | __initcall(per_linux32_init); | 686 | __initcall(per_linux32_init); |
| 687 | |||
| 688 | /** | ||
| 689 | * show_mem - give short summary of memory stats | ||
| 690 | * | ||
| 691 | * Shows a simple page count of reserved and used pages in the system. | ||
| 692 | * For discontig machines, it does this on a per-pgdat basis. | ||
| 693 | */ | ||
