0

I am using initramfs file system along with a kernel image and device tree. I am getting an exception while freeing the memory of the initrd after unpacking it.

The initramfs is unpacked successfully in the kernel boot process, but there is some issue in freeing the memory.

my bootargs :

setenv bootargs 'noinitrd init=/sample_exe console=ttySC0,115200 root=/dev/ram0 rw ramdisk_size=16384'

Please find the boot log below:

[ 0.175117] Trying to unpack rootfs image as initramfs...

[ 0.631972] ##free_initrd initrd_start ffffffc028000040

[ 0.631972] initrd_end ffffffc028d72ea3

[ 0.634079] BUG: Bad page state in process swapper/0 pfn:70400

[ 0.634089] page:ffffffbdc1c10000 count:0 mapcount:-127 mapping:
(null) index:0x0 [ 0.634093] flags: 0x0()

[ 0.634098] page dumped because: nonzero mapcount

[ 0.634102] Modules linked in:

[ 0.634112] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.4.0-yocto-standard #14

[ 0.634122] Call trace:

[ 0.634139] [] dump_backtrace+0x0/0x180

[ 0.634144] [] show_stack+0x14/0x20

[ 0.634153] [] dump_stack+0x90/0xc8

[ 0.634163] [] bad_page+0xc8/0x118

[ 0.634167] [] free_pages_prepare+0x1dc/0x248

[ 0.634172] [] free_hot_cold_page+0x28/0x1b8

[ 0.634176] [] __free_pages+0x40/0x50

[ 0.634180] [] free_reserved_area+0x8c/0x110

[ 0.634190] [] free_initrd_mem+0x20/0x2c

[ 0.634196] [] free_initrd+0x40/0x54

[ 0.634201] [] populate_rootfs+0xf4/0x110

[ 0.634206] [] do_one_initcall+0x8c/0x190

[ 0.634211] [] kernel_init_freeable+0x148/0x1ec

[ 0.634223] [] kernel_init+0x10/0xe8

[ 0.634228] [] ret_from_fork+0x10/0x40

0

My initrd image size is very less compared with RAM. So I retained the initrd image without freeing in kernel using below bootarfs.

set bootargs 'retain_initrd'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.