aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mm/init.c2
-rw-r--r--arch/ia64/mm/contig.c10
-rw-r--r--arch/ia64/mm/discontig.c10
-rw-r--r--arch/parisc/mm/init.c2
-rw-r--r--arch/sparc/kernel/setup_32.c2
-rw-r--r--arch/sparc/mm/init_32.c2
-rw-r--r--arch/unicore32/mm/init.c2
-rw-r--r--drivers/net/ioc3-eth.c2
-rw-r--r--drivers/tty/serial/68328serial.c2
-rw-r--r--include/linux/mm.h6
-rw-r--r--lib/show_mem.c2
-rw-r--r--mm/nommu.c6
-rw-r--r--mm/page_alloc.c22
13 files changed, 34 insertions, 36 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 76f82ae44efb..3f17ea146f0e 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -85,7 +85,7 @@ void show_mem(unsigned int filter)
85 struct meminfo * mi = &meminfo; 85 struct meminfo * mi = &meminfo;
86 86
87 printk("Mem-info:\n"); 87 printk("Mem-info:\n");
88 show_free_areas(); 88 show_free_areas(filter);
89 89
90 for_each_bank (i, mi) { 90 for_each_bank (i, mi) {
91 struct membank *bank = &mi->bank[i]; 91 struct membank *bank = &mi->bank[i];
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);
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 5fa1e273006e..c5c9c65e502d 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -686,7 +686,7 @@ void show_mem(unsigned int filter)
686 int shared = 0, cached = 0; 686 int shared = 0, cached = 0;
687 687
688 printk(KERN_INFO "Mem-info:\n"); 688 printk(KERN_INFO "Mem-info:\n");
689 show_free_areas(); 689 show_free_areas(filter);
690#ifndef CONFIG_DISCONTIGMEM 690#ifndef CONFIG_DISCONTIGMEM
691 i = max_mapnr; 691 i = max_mapnr;
692 while (i-- > 0) { 692 while (i-- > 0) {
diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c
index 3609bdee9ed2..3249d3f3234d 100644
--- a/arch/sparc/kernel/setup_32.c
+++ b/arch/sparc/kernel/setup_32.c
@@ -82,7 +82,7 @@ static void prom_sync_me(void)
82 "nop\n\t" : : "r" (&trapbase)); 82 "nop\n\t" : : "r" (&trapbase));
83 83
84 prom_printf("PROM SYNC COMMAND...\n"); 84 prom_printf("PROM SYNC COMMAND...\n");
85 show_free_areas(); 85 show_free_areas(0);
86 if(current->pid != 0) { 86 if(current->pid != 0) {
87 local_irq_enable(); 87 local_irq_enable();
88 sys_sync(); 88 sys_sync();
diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c
index 4c31e2b6e71b..28c2cc81c9a9 100644
--- a/arch/sparc/mm/init_32.c
+++ b/arch/sparc/mm/init_32.c
@@ -78,7 +78,7 @@ void __init kmap_init(void)
78void show_mem(unsigned int filter) 78void show_mem(unsigned int filter)
79{ 79{
80 printk("Mem-info:\n"); 80 printk("Mem-info:\n");
81 show_free_areas(); 81 show_free_areas(filter);
82 printk("Free swap: %6ldkB\n", 82 printk("Free swap: %6ldkB\n",
83 nr_swap_pages << (PAGE_SHIFT-10)); 83 nr_swap_pages << (PAGE_SHIFT-10));
84 printk("%ld pages of RAM\n", totalram_pages); 84 printk("%ld pages of RAM\n", totalram_pages);
diff --git a/arch/unicore32/mm/init.c b/arch/unicore32/mm/init.c
index 1fc02633f700..2d3e7112d2a3 100644
--- a/arch/unicore32/mm/init.c
+++ b/arch/unicore32/mm/init.c
@@ -62,7 +62,7 @@ void show_mem(unsigned int filter)
62 struct meminfo *mi = &meminfo; 62 struct meminfo *mi = &meminfo;
63 63
64 printk(KERN_DEFAULT "Mem-info:\n"); 64 printk(KERN_DEFAULT "Mem-info:\n");
65 show_free_areas(); 65 show_free_areas(filter);
66 66
67 for_each_bank(i, mi) { 67 for_each_bank(i, mi) {
68 struct membank *bank = &mi->bank[i]; 68 struct membank *bank = &mi->bank[i];
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
index 96c95617195f..32f07f868d89 100644
--- a/drivers/net/ioc3-eth.c
+++ b/drivers/net/ioc3-eth.c
@@ -915,7 +915,7 @@ static void ioc3_alloc_rings(struct net_device *dev)
915 915
916 skb = ioc3_alloc_skb(RX_BUF_ALLOC_SIZE, GFP_ATOMIC); 916 skb = ioc3_alloc_skb(RX_BUF_ALLOC_SIZE, GFP_ATOMIC);
917 if (!skb) { 917 if (!skb) {
918 show_free_areas(); 918 show_free_areas(0);
919 continue; 919 continue;
920 } 920 }
921 921
diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index d5bfd41707e7..e0a77540b8ca 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -281,7 +281,7 @@ static void receive_chars(struct m68k_serial *info, unsigned short rx)
281#ifdef CONFIG_MAGIC_SYSRQ 281#ifdef CONFIG_MAGIC_SYSRQ
282 } else if (ch == 0x10) { /* ^P */ 282 } else if (ch == 0x10) { /* ^P */
283 show_state(); 283 show_state();
284 show_free_areas(); 284 show_free_areas(0);
285 show_buffers(); 285 show_buffers();
286/* show_net_buffers(); */ 286/* show_net_buffers(); */
287 return; 287 return;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 6507dde38b16..1746f67c33de 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -862,13 +862,13 @@ extern void pagefault_out_of_memory(void);
862#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) 862#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK)
863 863
864/* 864/*
865 * Flags passed to show_mem() and __show_free_areas() to suppress output in 865 * Flags passed to show_mem() and show_free_areas() to suppress output in
866 * various contexts. 866 * various contexts.
867 */ 867 */
868#define SHOW_MEM_FILTER_NODES (0x0001u) /* filter disallowed nodes */ 868#define SHOW_MEM_FILTER_NODES (0x0001u) /* filter disallowed nodes */
869 869
870extern void show_free_areas(void); 870extern void show_free_areas(unsigned int flags);
871extern void __show_free_areas(unsigned int flags); 871extern bool skip_free_areas_node(unsigned int flags, int nid);
872 872
873int shmem_lock(struct file *file, int lock, struct user_struct *user); 873int shmem_lock(struct file *file, int lock, struct user_struct *user);
874struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags); 874struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags);
diff --git a/lib/show_mem.c b/lib/show_mem.c
index 90cbe4bb5960..4407f8c9b1f7 100644
--- a/lib/show_mem.c
+++ b/lib/show_mem.c
@@ -16,7 +16,7 @@ void show_mem(unsigned int filter)
16 nonshared = 0, highmem = 0; 16 nonshared = 0, highmem = 0;
17 17
18 printk("Mem-Info:\n"); 18 printk("Mem-Info:\n");
19 __show_free_areas(filter); 19 show_free_areas(filter);
20 20
21 for_each_online_pgdat(pgdat) { 21 for_each_online_pgdat(pgdat) {
22 unsigned long i, flags; 22 unsigned long i, flags;
diff --git a/mm/nommu.c b/mm/nommu.c
index c4c542c736a9..5afce48ce339 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1235,7 +1235,7 @@ error_free:
1235enomem: 1235enomem:
1236 printk("Allocation of length %lu from process %d (%s) failed\n", 1236 printk("Allocation of length %lu from process %d (%s) failed\n",
1237 len, current->pid, current->comm); 1237 len, current->pid, current->comm);
1238 show_free_areas(); 1238 show_free_areas(0);
1239 return -ENOMEM; 1239 return -ENOMEM;
1240} 1240}
1241 1241
@@ -1468,14 +1468,14 @@ error_getting_vma:
1468 printk(KERN_WARNING "Allocation of vma for %lu byte allocation" 1468 printk(KERN_WARNING "Allocation of vma for %lu byte allocation"
1469 " from process %d failed\n", 1469 " from process %d failed\n",
1470 len, current->pid); 1470 len, current->pid);
1471 show_free_areas(); 1471 show_free_areas(0);
1472 return -ENOMEM; 1472 return -ENOMEM;
1473 1473
1474error_getting_region: 1474error_getting_region:
1475 printk(KERN_WARNING "Allocation of vm region for %lu byte allocation" 1475 printk(KERN_WARNING "Allocation of vm region for %lu byte allocation"
1476 " from process %d failed\n", 1476 " from process %d failed\n",
1477 len, current->pid); 1477 len, current->pid);
1478 show_free_areas(); 1478 show_free_areas(0);
1479 return -ENOMEM; 1479 return -ENOMEM;
1480} 1480}
1481EXPORT_SYMBOL(do_mmap_pgoff); 1481EXPORT_SYMBOL(do_mmap_pgoff);
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 9d5498e2d0f5..b1447522d346 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2473,10 +2473,10 @@ void si_meminfo_node(struct sysinfo *val, int nid)
2473#endif 2473#endif
2474 2474
2475/* 2475/*
2476 * Determine whether the zone's node should be displayed or not, depending on 2476 * Determine whether the node should be displayed or not, depending on whether
2477 * whether SHOW_MEM_FILTER_NODES was passed to __show_free_areas(). 2477 * SHOW_MEM_FILTER_NODES was passed to show_free_areas().
2478 */ 2478 */
2479static bool skip_free_areas_zone(unsigned int flags, const struct zone *zone) 2479bool skip_free_areas_node(unsigned int flags, int nid)
2480{ 2480{
2481 bool ret = false; 2481 bool ret = false;
2482 2482
@@ -2484,8 +2484,7 @@ static bool skip_free_areas_zone(unsigned int flags, const struct zone *zone)
2484 goto out; 2484 goto out;
2485 2485
2486 get_mems_allowed(); 2486 get_mems_allowed();
2487 ret = !node_isset(zone->zone_pgdat->node_id, 2487 ret = !node_isset(nid, cpuset_current_mems_allowed);
2488 cpuset_current_mems_allowed);
2489 put_mems_allowed(); 2488 put_mems_allowed();
2490out: 2489out:
2491 return ret; 2490 return ret;
@@ -2500,13 +2499,13 @@ out:
2500 * Suppresses nodes that are not allowed by current's cpuset if 2499 * Suppresses nodes that are not allowed by current's cpuset if
2501 * SHOW_MEM_FILTER_NODES is passed. 2500 * SHOW_MEM_FILTER_NODES is passed.
2502 */ 2501 */
2503void __show_free_areas(unsigned int filter) 2502void show_free_areas(unsigned int filter)
2504{ 2503{
2505 int cpu; 2504 int cpu;
2506 struct zone *zone; 2505 struct zone *zone;
2507 2506
2508 for_each_populated_zone(zone) { 2507 for_each_populated_zone(zone) {
2509 if (skip_free_areas_zone(filter, zone)) 2508 if (skip_free_areas_node(filter, zone_to_nid(zone)))
2510 continue; 2509 continue;
2511 show_node(zone); 2510 show_node(zone);
2512 printk("%s per-cpu:\n", zone->name); 2511 printk("%s per-cpu:\n", zone->name);
@@ -2549,7 +2548,7 @@ void __show_free_areas(unsigned int filter)
2549 for_each_populated_zone(zone) { 2548 for_each_populated_zone(zone) {
2550 int i; 2549 int i;
2551 2550
2552 if (skip_free_areas_zone(filter, zone)) 2551 if (skip_free_areas_node(filter, zone_to_nid(zone)))
2553 continue; 2552 continue;
2554 show_node(zone); 2553 show_node(zone);
2555 printk("%s" 2554 printk("%s"
@@ -2618,7 +2617,7 @@ void __show_free_areas(unsigned int filter)
2618 for_each_populated_zone(zone) { 2617 for_each_populated_zone(zone) {
2619 unsigned long nr[MAX_ORDER], flags, order, total = 0; 2618 unsigned long nr[MAX_ORDER], flags, order, total = 0;
2620 2619
2621 if (skip_free_areas_zone(filter, zone)) 2620 if (skip_free_areas_node(filter, zone_to_nid(zone)))
2622 continue; 2621 continue;
2623 show_node(zone); 2622 show_node(zone);
2624 printk("%s: ", zone->name); 2623 printk("%s: ", zone->name);
@@ -2639,11 +2638,6 @@ void __show_free_areas(unsigned int filter)
2639 show_swap_cache_info(); 2638 show_swap_cache_info();
2640} 2639}
2641 2640
2642void show_free_areas(void)
2643{
2644 __show_free_areas(0);
2645}
2646
2647static void zoneref_set_zone(struct zone *zone, struct zoneref *zoneref) 2641static void zoneref_set_zone(struct zone *zone, struct zoneref *zoneref)
2648{ 2642{
2649 zoneref->zone = zone; 2643 zoneref->zone = zone;