bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

initrd breaks if VMALLOC_RESERVE is increased - Linux


From: Glenn A Diehl
Subject: initrd breaks if VMALLOC_RESERVE is increased - Linux
Date: Thu, 08 Jan 2004 13:03:52 -0500

Hello.
I have run into an interesting problem with grub 0.93.  This occurs with
the Linux 2.4.23 kernel from kernel.org running on an i386 platform with
SCSI disks and 2GB of memory.

I found that if I change VMALLOC_RESERVE in
/usr/src/linux/include/asm/page.h from:
    #define VMALLOC_RESERVE (128<<20)
to:
    #define VMALLOC_RESERVE (256<<20)

and recompile, etc. my kernel, the kernel never tries to mount the
initial ramdisk.  I found that "initrd_start" is 0 when the kernel code
checks it in prepare_namespace() in src/init/do_mounts.c.  As a result,
the system cannot mount the root partition because it can't find an
appropriate driver for the SCSI disks (supposed to be insmod'ed by
linuxrc, which never ran).


Further investigation showed that:
- Passing mem=896m on the kernel line doesn't help.
- Passing mem=768m on the kernel line does work, but then the kernel is
limited to that much memory, and we waste a 1GB+ of memory.
- Running the grub shell and doing everything by hand showed that:
    - Not passing a mem= option results in grub picking address
0x37fc7000 for "memto" (and hence lh->ramdisk_size) in stage2/boot.c.
    - Passing a mem=896m option results in grub picking the same address
(implying that grub doesn't detect the fact that the reserved vmalloc
area has grown).
    - Passing mem=768m results in grub picking 0x2ffc7000, and the
ramdisk then starts working.


I was able to "fix" this by changing:
    #define LINUX_INITRD_MAX_ADDRESS 0x38000000
to:
    #define LINUX_INITRD_MAX_ADDRESS 0x30000000
(i.e. reducing it by the same amount VMALLOC_RESERVE was increased) in
stage2/shared.h.  This allows the ramdisk to work and allows the kernel
to see all of system memory as desired.

Anyway, this isn't a very good fix, but it does shed light on the
problem.  Is there a correct way of making grub VMALLOC_RESERVE aware?

BTW, I tried using "uppermem" but that resulted in an "inconsistent file
system" error.

Thanks.

Glenn Diehl
address@hidden







reply via email to

[Prev in Thread] Current Thread [Next in Thread]