patch-2.4.15 linux/arch/ia64/mm/init.c

Next file: linux/arch/ia64/mm/tlb.c
Previous file: linux/arch/ia64/mm/fault.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.14/linux/arch/ia64/mm/init.c linux/arch/ia64/mm/init.c
@@ -167,13 +167,40 @@
 }
 
 void
-show_mem (void)
+show_mem(void)
 {
 	int i, total = 0, reserved = 0;
 	int shared = 0, cached = 0;
 
 	printk("Mem-info:\n");
 	show_free_areas();
+
+#ifdef CONFIG_DISCONTIGMEM
+	{
+		pg_data_t *pgdat = pgdat_list;
+
+		printk("Free swap:       %6dkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
+		do {
+			printk("Node ID: %d\n", pgdat->node_id);
+			for(i = 0; i < pgdat->node_size; i++) {
+				if (PageReserved(pgdat->node_mem_map+i))
+					reserved++;
+				else if (PageSwapCache(pgdat->node_mem_map+i))
+					cached++;
+				else if (page_count(pgdat->node_mem_map + i))
+					shared += page_count(pgdat->node_mem_map + i) - 1;
+			}
+			printk("\t%d pages of RAM\n", pgdat->node_size);
+			printk("\t%d reserved pages\n", reserved);
+			printk("\t%d pages shared\n", shared);
+			printk("\t%d pages swap cached\n", cached);
+			pgdat = pgdat->node_next;
+		} while (pgdat);
+		printk("Total of %ld pages in page table cache\n", pgtable_cache_size);
+		show_buffers();
+		printk("%d free buffer pages\n", nr_free_buffer_pages());
+	}
+#else /* !CONFIG_DISCONTIGMEM */
 	printk("Free swap:       %6dkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 	i = max_mapnr;
 	while (i-- > 0) {
@@ -191,6 +218,7 @@
 	printk("%d pages swap cached\n", cached);
 	printk("%ld pages in page table cache\n", pgtable_cache_size);
 	show_buffers();
+#endif /* !CONFIG_DISCONTIGMEM */
 }
 
 /*
@@ -248,7 +276,7 @@
 	ia64_clear_ic(flags);
 
 	rid = ia64_rid(IA64_REGION_ID_KERNEL, __IA64_UNCACHED_OFFSET);
-	ia64_set_rr(__IA64_UNCACHED_OFFSET, (rid << 8) | (KERNEL_PG_SHIFT << 2));
+	ia64_set_rr(__IA64_UNCACHED_OFFSET, (rid << 8) | (IA64_GRANULE_SHIFT << 2));
 
 	rid = ia64_rid(IA64_REGION_ID_KERNEL, VMALLOC_START);
 	ia64_set_rr(VMALLOC_START, (rid << 8) | (PAGE_SHIFT << 2) | 1);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)