This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Freeing unused kernel memory: 144K (c057a000 - c059e000)

Other Parts Discussed in Thread: AM1808, OMAPL138

Hi,

i am booting kernel 3.16.2 on very similar dm850-evm board (am1808, but nand flash 128M on aemif mt29f01Gabb).

I have not the system booting correctly, but stopping here:

.....
UBIFS: recovery needed
UBIFS: recovery completed
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
UBIFS: FS size: 56504320 bytes (53 MiB, 445 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
UBIFS: reserved for root: 0 bytes (0 KiB)
UBIFS: media format: w4/r0 (latest is w4/r0), UUID 99CD8F86-35E5-4CDE-A945-DA3E4CAAB1CD, small LPT model
VFS: Mounted root (ubifs filesystem) on device 0:12.
Freeing unused kernel memory: 144K (c057a000 - c059e000)

  • Hi Steven,

    Try to enable "DEVTMPFS" and "DEVTMP" support in kernel.

  • DEVTMP is not anymore, seems.

    DEVTMPFS added, no changes.

    I tried also to add CONFIG_DEVTMPFS_MOUNT, but system now reboots after the "Freeing" message so i removed them.

    Is possible some __init or __inidata area is removed at "Freeing", and it is still needed ?

  • Hi Steven,

    The below configurations are required for the latest linux kernel.

    1) Try to enable the both configs in menuconfig.

    CONFIG_DEVTMPFS=y
    CONFIG_DEVTMPFS_MOUNT=y


    2) Try to pass "init=/bin/init"

    3) Some portions of code incorrectly marked as __init and also for __initdata.

    Do you have added any your own driver as inbuilt with uImage (kernel image) ?

  • Hi,

    well, i tried

    CONFIG_DEVTMPFS=y
    CONFIG_DEVTMPFS_MOUNT=y

    "init=/bin/init"

    Device reboots now after "Freeing. ..."

    Yes, i am using a mix of Device Tree and my own board.c startup (chanhed MACHINE_START into DT_MACHINE_START suffix to my board.c), since we are doing some custom operations at boot that i wouldn't do using the Device Tree.

    As far as you know, is it possible to boot without using DT at all ? From some testings i did, seems it is mandatory, or i couldn't boot without the dt blob.

    I am checking __init and __initdata entries, but if DT is mandatory now, i probably cannot go with a mixed solution, since it can cause this kind of troubles. Is it ?

    Thanks

  • Hi Steven,

    I'm suspecting filesystem.

    I have got the similar issues when I tried to port linux3.16 on my OMAPL138 LCDK board which is same as AM1808 but OMAPL138 had DSP too.

    I have stuck with "freeing unused memory" but I'm able to succeed with angstrom filesystem.

    Please try to build angstrom filesystem through online for "am180x-evm" machine.

    http://narcissus.angstrom-distribution.org/

  • Hi Titus,

    thanks for the help-

    I did the following:

    1) excluded the file system

    - flashed a previous kernel, boots correctly the same rootfs.ubi

    - crosse-check. flashed a different jffs2 image with 3.16.2 kernel, same issue, boot stops at "Freeing unused kernel memory"

    2) excluded interrupts

    verified they works with button press

    3) set several traces inside kernel, at the end execution (do_execve) of /sbin/init returns immediately a 0.

    So, /sbin/init is returning without errors (0) but immediately, and i think i am facing maybe some libc version error or something like that.

    Will let you know soon if i solve.

    Regards

  • Did still a test, used /bin/sh as init  command, shell works, i can browse the file system,, so it seems to be a devtmpfs issue, that cannot be allocated at right time.

    Anyway, simply enabling the 2 options as suggested is not enough.

    I am looking inside it.

  • Dear,

    still some progresses, i used the last busybox "init" and had at least some more info as output:

    UBIFS: background thread "ubifs_bgt0_0" started, PID 952
    UBIFS: start fixing up free space
    UBIFS: free space fixup complete
    UBIFS: mounted UBI device 0, volume 0, name "rootfs"
    UBIFS: LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
    UBIFS: FS size: 56504320 bytes (53 MiB, 445 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
    UBIFS: reserved for root: 0 bytes (0 KiB)
    UBIFS: media format: w4/r0 (latest is w4/r0), UUID CA898D1C-29C4-4634-870E-300E3CC317B7, small LPT model
    VFS: Mounted root (ubifs filesystem) on device 0:13.
    devtmpfs: mounted
    ** kernel_init ** : freeing memory
    Freeing unused kernel memory: 144K (c058e000 - c05b2000)
    ** kernel_init ** : mark_rodata_ro
    ** kernel_init ** : numa_default_policy
    ** kernel_init ** : flush_delayed_fput
    ** kernel_init ** : execute_command /sbin/init:
    ** kernel_init ** : init_process exexuted ret:0
    Bad inittab entry at line 5
    can't open /dev/si: No such file or directory
    can't open /dev/~~: No such file or directory
    can't open /dev/l0: No such file or directory
    can't open /dev/l1: No such file or directory
    can't open /dev/l2: No such file or directory
    can't open /dev/l3: No such file or directory
    can't open /dev/l4: No such file or directory
    can't open /dev/l5: No such file or directory
    can't open /dev/l6: No such file or directory
    can't open /dev/sc: No such file or directory
    can't open /dev/S0: No such file or directory
    can't open /dev/S0: No such file or directory
    can't open /dev/S0: No such file or directory
    can't open /dev/S0: No such file or directory
    can't open /dev/S0: No such file or directory
    can't open /dev/S0: No such file or directory
    can't open /dev/S0: No such file or directory
    can't open /dev/S0: No such file or directory
    can't open /dev/S0: No such file or directory
    can't open /dev/S0: No such file or directory
    can't open /dev/S0: No such file or directory
    can't open /dev/S0: No such file or directory
    can't open /dev/S0: No such file or directory

    Inittab:



    # /etc/inittab: init(8) configuration.
    # $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $
    
    # The default runlevel.
    id:2:initdefault:
    
    # Boot-time system configuration/initialization script.
    # This is run first except when booting in emergency (-b) mode.
    si::sysinit:/etc/init.d/rcS
    
    # Runtime re-configuration request on configuration change
    sc:c:once:/etc/init.d/rcC
    
    # What to do in single-user mode.
    ~~:S:wait:/sbin/sulogin
    
    # /etc/init.d executes the S and K scripts upon change
    # of runlevel.
    #
    # Runlevel 0 is halt.
    # Runlevel 1 is single-user maintenance mode (no app running)
    # Runlevel 2 is the full functionality application run
    # Runlevels 3-4 are unused, they link to runlevel 2
    # Runlevel 5 is a production test
    # Runlevel 6 is reboot.
    
    l0:0:wait:/etc/init.d/rc 0
    l1:1:wait:/etc/init.d/rc 1
    l2:2:wait:/etc/init.d/rc 2
    l3:3:wait:/etc/init.d/rc 3
    l4:4:wait:/etc/init.d/rc 4
    l5:5:wait:/etc/init.d/rc 5
    l6:6:wait:/etc/init.d/rc 6
    

    Going ahead investigating

  • Solved.

    It was really a special "custom" issue. Building rootfs from buildroot, init binary was set as "sysVinit"  and inittab was as per sysV. But erroneusly, busybox init was overwriting the sysV init. Mainly, it was not able to start the console.

    Now, busybox init and busybox syntax inittab works.

    thanks all-

  • Hi Steven,

    Sounds good.

    Thanks for your update.

  • Hi,

    no, i apologize, was tired and made confusion, have to re-open:

    Seems i have solved sice i used BusyBox "init" binary that runs. But, was only for an error i used busybox init. The system runs instead as default with systemV "init" binary.

    Using systemV init, system reboots silently without any oops/dump just after /sbin/init (that executes and returns 0 immediately).

    So, the correct answer to this issue was the first you gave me:

    CONFIG_DEVTMP

    CONFIG_DEVTMPFS_MOUNT

    must be enabled with kernel 3.16.2.

    Now i have to re-fight for this new issue.

    Best Regards

  • Hi Steven,

    You can use busybox "init" right?

    What is the problem now ?

    Do you have any problem on using the busybox init ?

  • Dear Titus,


    well Busybox init starts, and executes some init steps of the init until the maintenance console login (Ctrl-D request).  If i don't login, and press enter (normal boot), kernel reboots silently just after.

    Anyway i have to use systemV "/sbin/init", that reboots silently after have been invoked.

    So, i have put some debug traces inside init.c systemV sources, and found that kernel crashes silently when the application touch a global bss variable called "reload" (put fprintfs before and after the access).


    /*    Used by re-exec part */
    int reload = 0;            /* Should we do initialization stuff? */

    fighting on it. every help is appreciated, thanks

  • Have you tried "angstrom" filesystem as I mentioned earlier ?

  • Hi,

    at the end i didn't tried that image, it was tar.gz only, ubi or jffs2 generation is broken (you can try) and was a bit complex to generate ubi image. So i tried old kernel 3.5.1 with same image and boot was normal.

    After further investigations, i pus several traces inside systemv init, and found that console was broken, the exact point where the program was causing reboot was not accessing the variable, as i said above, but just below (next fprintf was not flushed) accessing the virtual terminal.

    I removed virtual terminal erroneously set on the menuconfig, and all worked as expected.

    So, was mainly an issues of selecting virtual terminal for error, or when i ported the old .config, or has been auto-selected for some reason.

    May thanks TI guys for the great and fast support.

  • Hi Steven,

    Thanks for your update.

  • Issue with no end.

    I have unfortunately to use Virtual Terminal for other apps after boot.

    So i have to go ahead investigating on the silent reboot issue. Also, this silent reboot just selecting a driver is a sign that something in the kernel is broken. Older kernel 3.5.1 and same file system boots properly.


    With virtual terminal enabled system reboots here:

    #ifdef __linux__
        /*
         *    Tell the kernel to send us SIGINT when CTRL-ALT-DEL
         *    is pressed, and that we want to handle keyboard signals.
         */
        init_reboot(BMAGIC_SOFT);
    >>>>    if ((f = open(VT_MASTER, O_RDWR | O_NOCTTY)) >= 0) {
                (void) ioctl(f, KDSIGACCEPT, SIGWINCH);
                close(f);
        } else
            (void) ioctl(0, KDSIGACCEPT, SIGWINCH);
    #endif

  • Finally, about this: moved to 3.17 kernel, this silent reboot on VT selection disappeared.

    Thanks again.

  • Hi Steven,

    Thanks for your update and your solution.

    Did you find any "make menuconfig" changes or any code changes in linux 3.17 ?

    Have you checked the release changes between linux 3.16 & 3.17 ?