xtensa: don't make bootmem bitmap larger than required
[linux-2.6.git] / arch / xtensa / mm / init.c
index 81d0560..a534d52 100644 (file)
@@ -130,7 +130,8 @@ void __init bootmem_init(void)
 
        /* Find an area to use for the bootmem bitmap. */
 
-       bootmap_size = bootmem_bootmap_pages(max_low_pfn) << PAGE_SHIFT;
+       bootmap_size = bootmem_bootmap_pages(max_low_pfn - min_low_pfn);
+       bootmap_size <<= PAGE_SHIFT;
        bootmap_start = ~0;
 
        for (i=0; i<sysmem.nr_banks; i++)
@@ -145,8 +146,9 @@ void __init bootmem_init(void)
        /* Reserve the bootmem bitmap area */
 
        mem_reserve(bootmap_start, bootmap_start + bootmap_size, 1);
-       bootmap_size = init_bootmem_node(NODE_DATA(0), min_low_pfn,
+       bootmap_size = init_bootmem_node(NODE_DATA(0),
                                         bootmap_start >> PAGE_SHIFT,
+                                        min_low_pfn,
                                         max_low_pfn);
 
        /* Add all remaining memory pieces into the bootmem map */
@@ -280,36 +282,9 @@ void free_initmem(void)
               (&__init_end - &__init_begin) >> 10);
 }
 
-void show_mem(void)
-{
-       int i, free = 0, total = 0, reserved = 0;
-       int shared = 0, cached = 0;
-
-       printk("Mem-info:\n");
-       show_free_areas();
-       printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
-       i = max_mapnr;
-       while (i-- > 0) {
-               total++;
-               if (PageReserved(mem_map+i))
-                       reserved++;
-               else if (PageSwapCache(mem_map+i))
-                       cached++;
-               else if (!page_count(mem_map + i))
-                       free++;
-               else
-                       shared += page_count(mem_map + i) - 1;
-       }
-       printk("%d pages of RAM\n", total);
-       printk("%d reserved pages\n", reserved);
-       printk("%d pages shared\n", shared);
-       printk("%d pages swap cached\n",cached);
-       printk("%d free pages\n", free);
-}
-
 struct kmem_cache *pgtable_cache __read_mostly;
 
-static void pgd_ctor(struct kmem_cache *cache, void* addr)
+static void pgd_ctor(void* addr)
 {
        pte_t* ptep = (pte_t*)addr;
        int i;