patch-2.4.13 linux/arch/arm/mm/init.c

Next file: linux/arch/arm/mm/mm-ftvpci.c
Previous file: linux/arch/arm/mm/fault-common.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.12/linux/arch/arm/mm/init.c linux/arch/arm/mm/init.c
@@ -96,10 +96,22 @@
 }
 #endif
 
+/* This is currently broken
+ * PG_skip is used on sparc/sparc64 architectures to "skip" certain
+ * parts of the address space.
+ *
+ * #define PG_skip	10
+ * #define PageSkip(page) (machine_is_riscpc() && test_bit(PG_skip, &(page)->flags))
+ *			if (PageSkip(page)) {
+ *				page = page->next_hash;
+ *				if (page == NULL)
+ *					break;
+ *			}
+ */
 void show_mem(void)
 {
 	int free = 0, total = 0, reserved = 0;
-	int shared = 0, cached = 0, node;
+	int shared = 0, cached = 0, slab = 0, node;
 
 	printk("Mem-info:\n");
 	show_free_areas();
@@ -112,23 +124,13 @@
 		end  = page + NODE_DATA(node)->node_size;
 
 		do {
-/* This is currently broken
- * PG_skip is used on sparc/sparc64 architectures to "skip" certain
- * parts of the address space.
- *
- * #define PG_skip	10
- * #define PageSkip(page) (machine_is_riscpc() && test_bit(PG_skip, &(page)->flags))
- *			if (PageSkip(page)) {
- *				page = page->next_hash;
- *				if (page == NULL)
- *					break;
- *			}
- */
 			total++;
 			if (PageReserved(page))
 				reserved++;
 			else if (PageSwapCache(page))
 				cached++;
+			else if (PageSlab(page))
+				slab++;
 			else if (!page_count(page))
 				free++;
 			else
@@ -140,6 +142,7 @@
 	printk("%d pages of RAM\n", total);
 	printk("%d free pages\n", free);
 	printk("%d reserved pages\n", reserved);
+	printk("%d slab pages\n", slab);
 	printk("%d pages shared\n", shared);
 	printk("%d pages swap cached\n", cached);
 #ifndef CONFIG_NO_PGT_CACHE
@@ -375,6 +378,8 @@
 	 */
 	if (machine_is_archimedes() || machine_is_a5k())
 		reserve_bootmem_node(pgdat, 0x02000000, 0x00080000);
+	if (machine_is_edb7211())
+		reserve_bootmem_node(pgdat, 0xc0000000, 0x00020000);
 	if (machine_is_p720t())
 		reserve_bootmem_node(pgdat, PHYS_OFFSET, 0x00014000);
 #ifdef CONFIG_SA1111
@@ -471,6 +476,7 @@
 
 	if (map_pg != bootmap_pfn + bootmap_pages)
 		BUG();
+
 }
 
 /*
@@ -528,6 +534,12 @@
 				(bdata->node_boot_start >> PAGE_SHIFT);
 
 		/*
+		 * If this zone has zero size, skip it.
+		 */
+		if (!zone_size[0])
+			continue;
+
+		/*
 		 * For each bank in this node, calculate the size of the
 		 * holes.  holes = node_size - sum(bank_sizes_in_node)
 		 */
@@ -598,8 +610,12 @@
 		create_memmap_holes(&meminfo);
 
 	/* this will put all unused low memory onto the freelists */
-	for (node = 0; node < numnodes; node++)
-		totalram_pages += free_all_bootmem_node(NODE_DATA(node));
+	for (node = 0; node < numnodes; node++) {
+		pg_data_t *pgdat = NODE_DATA(node);
+
+		if (pgdat->node_size != 0)
+			totalram_pages += free_all_bootmem_node(pgdat);
+	}
 
 #ifdef CONFIG_SA1111
 	/* now that our DMA memory is actually so designated, we can free it */

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