Skip to contentSkip to conversation

2.6.26.8-rt16 powerpc and mem=...

DISCUSSION Florian Boelstler 1 participant 4 messages Feb 17, 2009 – Feb 18, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

I'm currently running 2.6.26.8-rt16 on a custom MPC8540-based board.
I was wondering whether there is any experience reducing the available memory using the mem= kernel argument on linux-rt. (Use case: A specific memory portion is reserved for configuration data, which is set by an external system attached over PCI)

It seems that there is a race condition, which is hit during extraction of the initrd only if the available memory is reduced. (For vanilla 2.6.26.8 it works without any problems. The problem occurs in 2.6.24.7-rt24 as well)

[...]
RAMDISK: Compressed image found at block 0
crc error
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 140k init

Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
Call Trace:
[d7441e90] [c00072c4] show_stack+0x54/0x188 (unreliable)
[d7441ec0] [c0020d58] panic+0x98/0x160
[d7441f50] [c0001bf8] name_to_dev_t+0x0/0x25c
[d7441f60] [c03059e0] kernel_init+0x250/0x284
[d7441ff0] [c000d910] kernel_thread+0x44/0x60

Sometimes the output is slightly different, and init is actually called. But the file system is corrupt. E.g.:

[...]
RAMDISK: Compressed image found at block 0
RAMDISK: incomplete write (-28 != 7032) 33554432
crc error
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 140k init
init started: BusyBox v1.1.0 (2007.01.23-00:05+0000) multi-call binary
[...]
EXT2-fs error (device ram0): ext2_check_page: bad entry in directory #1594: : directory entry across blocks - offset=0, inode=909341804, rec_len=14392, name_len=55 Remounting filesystem read-only
[...]

In a single case Linux even booted without any problems.

Some details about my setup:
- 512MB RAM in total
- Memory available for Linux is reduced to 508M (mem=520192K)
- Linux is booted from U-Boot (v1.2.0), which places the initrd image in lowmem below 0x18000000 (initrd_high=0x18000000). This is done because Linux seems to not allow having the initrd in highmem. (Output from kernel regarding CAMs: "Memory CAM mapping: CAM0=256Mb, CAM1=64Mb, CAM2=64Mb residual: 124Mb")

#1 lore raw

Sorry, that message was sent too early.

Additionally I put the boot output here:
http://pastebin.ch/1009

Please let me know if you need any other information, which may help fixing this issue.

Thanks.

Cheers,

Florian

#2 lore raw
In reply to Florian Boelstler

Hi,

I did some further tests in the meanwhile.
If the memory is reduced to 256M with mem=256M Linux does not make use of highmem, since memory can be completely mapped using a single CAM entry. (Kernel output: Memory CAM mapping: CAM0=256Mb, CAM1=0Mb, CAM2=0Mb residual: 0Mb)

In that case the initrd is successfully mounted at all times up to now.

When I was starting to play with mem=... on vanilla kernels I was told [1] that it should be trivial to allow more than three levels of CAM mappings. May be this is an intermediate solution.

Florian

[1] http://ozlabs.org/pipermail/linuxppc-embedded/2008-June/030638.html

#3 lore raw

Hi again,

I adapted the kernel to allow a four-level CAM mapping.
If the memory is reduced to 448M (i.e. result is CAM0=256Mb, CAM1=64Mb, CAM2=64Mb CAM3=64Mb residual: 0Mb) there will be no highmem assigned by the kernel at all.

In that case the U-Boot boot loader is set to initrd_high=0x1C000000, i.e. it will put the initrd right at the "upper end" of available memory.

linux-rt doesn't fail to mount the initrd.

I tend to believe that the issue is related to the use of highmem in linux-rt (OK, pretty vague:).

Florian