Query about /proc/meminfo

Arshad Hussain arshad.super at gmail.com
Fri Dec 12 19:38:54 EST 2014


On 10-Dec-2014, at 10:18 pm, PRAJAPATI MEHUL <mehulprajapati2802 at gmail.com> wrote:

> Hi,
> 
> -I am currently working on one embedded development board.
> -I have ported 3.0.31 kernel with my personal patches on it.
> 
> -When I am trying to insert my module, it fails to allocate 4MB memory using kmalloc.
> 
> -Below is a snapshot of cat /proc/meminfo command of my embedded linux system.
> 
> <Selection_001.png>
> 
> -According to my understanding, LowFree parameter indicates free memory in kernel space which is around 536MB in this case.
> 
> -There is a lot free space available in kernel space then 
> why module fails in kmalloc of 4MB ?
> 
> -Also find the attached log messages of dmesg
> 
> Regards,
> Mehul
> 
> <dmesg.log>_______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

My 2 Cents.

Your dmesg says it cannot allocate 2^10 * PAGESIZE (what ever the pagesize is). 

At first glance it looks like memory fragmentation. Over time allocations will split to a point it will fail a request because of lake of continous pages. Have a look what your /proc/buddyinfo says. Try out with vmalloc (just for exercise) or try your module just after machine reboot. Please also note there is a limit on kmalloc, how much it can allocate at single go.

Thanks
Arshad

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20141212/2e24e8f2/attachment.html 


More information about the Kernelnewbies mailing list