Not able to mlock - Embedded

This is a discussion on Not able to mlock - Embedded ; Hi all!, I am not able to mlock more than half of the memory available. I am working on ARM processor in which 64 MB of SDRAM memory is available. But I am not able to mlock more than 32 ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Not able to mlock

  1. Not able to mlock

    Hi all!,

    I am not able to mlock more than half of the memory available. I am
    working on ARM processor in

    which
    64 MB of SDRAM memory is available. But I am not able to mlock more
    than 32 MB. If I am trying to

    allocate more than 32 MB, it return
    an ENOMEM error. Can any one suggest me why this is happening and what
    is the way to mlock more

    than 32 MB?
    Please let me know, do I need to set the limit for mlock in kernel? If
    so, where do I set the

    limit for mlock?

    Thanks and Regards,
    P.R.Hariram


  2. Re: Not able to mlock

    In article <1156748190.146414.68650@b28g2000cwb.googlegroups.c om>,
    "Hari" writes:
    > I am not able to mlock more than half of the memory available. I am
    > working on ARM processor in
    >
    > which
    > 64 MB of SDRAM memory is available. But I am not able to mlock more
    > than 32 MB. If I am trying to
    >
    > allocate more than 32 MB, it return
    > an ENOMEM error. Can any one suggest me why this is happening and what
    > is the way to mlock more
    >
    > than 32 MB?
    > Please let me know, do I need to set the limit for mlock in kernel? If
    > so, where do I set the
    >
    > limit for mlock?


    IIRC, this limit is hard-coded in the kernel: The mlock() syscall
    won't allow you to lock more than half of the physical memory. The
    rationale is probably that if you lock too much memory, you might
    lock up the machine. Whether it is helpful to impose a hard-coded
    limit like this remains to be discussed...

    (Moreover, at least older Linux kernels (<= 2.2 series) used to impose
    this limit *per process*, so multiple processes could sucessfully lock
    half of the physical memory *each*, and thus together they could still
    manage to bring down the system. This may have been improved in more
    recent kernels, though.)

    Rob

    --
    Robert Kaiser email: rkaiser AT sysgo DOT com
    SYSGO AG http://www.elinos.com
    Klein-Winternheim / Germany http://www.sysgo.com

+ Reply to Thread