]> Pileus Git - ~andy/linux/blobdiff - arch/ia64/mm/init.c
Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osd
[~andy/linux] / arch / ia64 / mm / init.c
index 88504abf570429886183d32d9b857a90adb5c148..25c350264a41012bba72d3d992674aea17d32fba 100644 (file)
@@ -684,3 +684,51 @@ per_linux32_init(void)
 }
 
 __initcall(per_linux32_init);
+
+/**
+ * show_mem - give short summary of memory stats
+ *
+ * Shows a simple page count of reserved and used pages in the system.
+ * For discontig machines, it does this on a per-pgdat basis.
+ */
+void show_mem(unsigned int filter)
+{
+       int total_reserved = 0;
+       unsigned long total_present = 0;
+       pg_data_t *pgdat;
+
+       printk(KERN_INFO "Mem-info:\n");
+       show_free_areas(filter);
+       printk(KERN_INFO "Node memory in pages:\n");
+       for_each_online_pgdat(pgdat) {
+               unsigned long present;
+               unsigned long flags;
+               int reserved = 0;
+               int nid = pgdat->node_id;
+               int zoneid;
+
+               if (skip_free_areas_node(filter, nid))
+                       continue;
+               pgdat_resize_lock(pgdat, &flags);
+
+               for (zoneid = 0; zoneid < MAX_NR_ZONES; zoneid++) {
+                       struct zone *zone = &pgdat->node_zones[zoneid];
+                       if (!populated_zone(zone))
+                               continue;
+
+                       reserved += zone->present_pages - zone->managed_pages;
+               }
+               present = pgdat->node_present_pages;
+
+               pgdat_resize_unlock(pgdat, &flags);
+               total_present += present;
+               total_reserved += reserved;
+               printk(KERN_INFO "Node %4d:  RAM: %11ld, rsvd: %8d, ",
+                      nid, present, reserved);
+       }
+       printk(KERN_INFO "%ld pages of RAM\n", total_present);
+       printk(KERN_INFO "%d reserved pages\n", total_reserved);
+       printk(KERN_INFO "Total of %ld pages in page table cache\n",
+              quicklist_total_size());
+       printk(KERN_INFO "%ld free buffer pages\n", nr_free_buffer_pages());
+}