aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2011-05-24 20:11:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 11:39:03 -0400
commit7bf02ea22c6cdd09e2d3f1d3c3fe366b834ae9af (patch)
treec1c8aa415910e0f0deea1181759ddd2b5d6067fb /arch/ia64
parent851cc856d73d1185243c149ed0c0839df8a1b2fe (diff)
arch, mm: filter disallowed nodes from arch specific show_mem functions
Architectures that implement their own show_mem() function did not pass the filter argument to show_free_areas() to appropriately avoid emitting the state of nodes that are disallowed in the current context. This patch now passes the filter argument to show_free_areas() so those nodes are now avoided. This patch also removes the show_free_areas() wrapper around __show_free_areas() and converts existing callers to pass an empty filter. ia64 emits additional information for each node, so skip_free_areas_zone() must be made global to filter disallowed nodes and it is converted to use a nid argument rather than a zone for this use case. Signed-off-by: David Rientjes <rientjes@google.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Helge Deller <deller@gmx.de> Cc: James Bottomley <jejb@parisc-linux.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/mm/contig.c10
-rw-r--r--arch/ia64/mm/discontig.c10
2 files changed, 12 insertions, 8 deletions
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c
index 9a018cde5d84..f114a3b14c6a 100644
--- a/arch/ia64/mm/contig.c
+++ b/arch/ia64/mm/contig.c
@@ -44,13 +44,16 @@ void show_mem(unsigned int filter)
44 pg_data_t *pgdat; 44 pg_data_t *pgdat;
45 45
46 printk(KERN_INFO "Mem-info:\n"); 46 printk(KERN_INFO "Mem-info:\n");
47 show_free_areas(); 47 show_free_areas(filter);
48 printk(KERN_INFO "Node memory in pages:\n"); 48 printk(KERN_INFO "Node memory in pages:\n");
49 for_each_online_pgdat(pgdat) { 49 for_each_online_pgdat(pgdat) {
50 unsigned long present; 50 unsigned long present;
51 unsigned long flags; 51 unsigned long flags;
52 int shared = 0, cached = 0, reserved = 0; 52 int shared = 0, cached = 0, reserved = 0;
53 int nid = pgdat->node_id;
53 54
55 if (skip_free_areas_node(filter, nid))
56 continue;
54 pgdat_resize_lock(pgdat, &flags); 57 pgdat_resize_lock(pgdat, &flags);
55 present = pgdat->node_present_pages; 58 present = pgdat->node_present_pages;
56 for(i = 0; i < pgdat->node_spanned_pages; i++) { 59 for(i = 0; i < pgdat->node_spanned_pages; i++) {
@@ -64,8 +67,7 @@ void show_mem(unsigned int filter)
64 if (max_gap < LARGE_GAP) 67 if (max_gap < LARGE_GAP)
65 continue; 68 continue;
66#endif 69#endif
67 i = vmemmap_find_next_valid_pfn(pgdat->node_id, 70 i = vmemmap_find_next_valid_pfn(nid, i) - 1;
68 i) - 1;
69 continue; 71 continue;
70 } 72 }
71 if (PageReserved(page)) 73 if (PageReserved(page))
@@ -81,7 +83,7 @@ void show_mem(unsigned int filter)
81 total_cached += cached; 83 total_cached += cached;
82 total_shared += shared; 84 total_shared += shared;
83 printk(KERN_INFO "Node %4d: RAM: %11ld, rsvd: %8d, " 85 printk(KERN_INFO "Node %4d: RAM: %11ld, rsvd: %8d, "
84 "shrd: %10d, swpd: %10d\n", pgdat->node_id, 86 "shrd: %10d, swpd: %10d\n", nid,
85 present, reserved, shared, cached); 87 present, reserved, shared, cached);
86 } 88 }
87 printk(KERN_INFO "%ld pages of RAM\n", total_present); 89 printk(KERN_INFO "%ld pages of RAM\n", total_present);
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index 82ab1bc6afb1..c641333cd997 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -622,13 +622,16 @@ void show_mem(unsigned int filter)
622 pg_data_t *pgdat; 622 pg_data_t *pgdat;
623 623
624 printk(KERN_INFO "Mem-info:\n"); 624 printk(KERN_INFO "Mem-info:\n");
625 show_free_areas(); 625 show_free_areas(filter);
626 printk(KERN_INFO "Node memory in pages:\n"); 626 printk(KERN_INFO "Node memory in pages:\n");
627 for_each_online_pgdat(pgdat) { 627 for_each_online_pgdat(pgdat) {
628 unsigned long present; 628 unsigned long present;
629 unsigned long flags; 629 unsigned long flags;
630 int shared = 0, cached = 0, reserved = 0; 630 int shared = 0, cached = 0, reserved = 0;
631 int nid = pgdat->node_id;
631 632
633 if (skip_free_areas_node(filter, nid))
634 continue;
632 pgdat_resize_lock(pgdat, &flags); 635 pgdat_resize_lock(pgdat, &flags);
633 present = pgdat->node_present_pages; 636 present = pgdat->node_present_pages;
634 for(i = 0; i < pgdat->node_spanned_pages; i++) { 637 for(i = 0; i < pgdat->node_spanned_pages; i++) {
@@ -638,8 +641,7 @@ void show_mem(unsigned int filter)
638 if (pfn_valid(pgdat->node_start_pfn + i)) 641 if (pfn_valid(pgdat->node_start_pfn + i))
639 page = pfn_to_page(pgdat->node_start_pfn + i); 642 page = pfn_to_page(pgdat->node_start_pfn + i);
640 else { 643 else {
641 i = vmemmap_find_next_valid_pfn(pgdat->node_id, 644 i = vmemmap_find_next_valid_pfn(nid, i) - 1;
642 i) - 1;
643 continue; 645 continue;
644 } 646 }
645 if (PageReserved(page)) 647 if (PageReserved(page))
@@ -655,7 +657,7 @@ void show_mem(unsigned int filter)
655 total_cached += cached; 657 total_cached += cached;
656 total_shared += shared; 658 total_shared += shared;
657 printk(KERN_INFO "Node %4d: RAM: %11ld, rsvd: %8d, " 659 printk(KERN_INFO "Node %4d: RAM: %11ld, rsvd: %8d, "
658 "shrd: %10d, swpd: %10d\n", pgdat->node_id, 660 "shrd: %10d, swpd: %10d\n", nid,
659 present, reserved, shared, cached); 661 present, reserved, shared, cached);
660 } 662 }
661 printk(KERN_INFO "%ld pages of RAM\n", total_present); 663 printk(KERN_INFO "%ld pages of RAM\n", total_present);