public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Takanori Kawano <t-kawano@ebina.hitachi.co.jp>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] [PATCH] free_initrd_mem() need to be correct
Date: Thu, 28 Jun 2001 03:02:48 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590693005795@msgid-missing> (raw)

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




                 reply	other threads:[~2001-06-28  3:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-ia64-105590693005795@msgid-missing \
    --to=t-kawano@ebina.hitachi.co.jp \
    --cc=linux-ia64@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox