public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] [PATCH] free_initrd_mem() need to be correct
@ 2001-06-28  3:02 Takanori Kawano
  0 siblings, 0 replies; only message in thread
From: Takanori Kawano @ 2001-06-28  3:02 UTC (permalink / raw)
  To: linux-ia64

When I tried to boot kernel using 'memQ2m' option on Bigsur 
with 1GB memory, it failed and displayed the following message.

           .
           .
    Freeing initrd memory: 746KB freed.
    kernel BUG at page_alloc.c:86!

On our investigation, the cause is that:
(1) When 'mem=xxx' is used, it is possible that the page corresponds to
    the memory used by initrd is not made because initrd is loaded into 
    high address region by bootloader.
(2) free_initrd_mem() frees the memory used by initrd even if its 
    corresponding page was not exist.

The following patch corrects this problem.

--- ./arch/ia64/mm/init.c       Thu Jun 28 10:16:45 2001
+++ ./arch/ia64/mm/init.c.new   Thu Jun 28 09:57:58 2001
@@ -141,10 +141,12 @@
                printk ("Freeing initrd memory: %ldkB freed\n", (end - start) >>
 10);

        for (; start < end; start += PAGE_SIZE) {
-               clear_bit(PG_reserved, &virt_to_page(start)->flags);
-               set_page_count(virt_to_page(start), 1);
-               free_page(start);
-               ++totalram_pages;
+               if (VALID_PAGE(virt_to_page(start))) {
+                       clear_bit(PG_reserved, &virt_to_page(start)->flags);
+                       set_page_count(virt_to_page(start), 1);
+                       free_page(start);
+                       ++totalram_pages;
+               }
        }
 }

---
Takanori Kawano
Hitachi Ltd,
Internet Systems Platform Division
t-kawano@ebina.hitachi.co.jp




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-06-28  3:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-06-28  3:02 [Linux-ia64] [PATCH] free_initrd_mem() need to be correct Takanori Kawano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox