<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 10-Dec-2014, at 10:18 pm, PRAJAPATI MEHUL &lt;<a href="mailto:mehulprajapati2802@gmail.com">mehulprajapati2802@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">Hi,<div><br></div><div>-I am currently working on one embedded development board.</div><div>-I have ported 3.0.31 kernel with my personal patches on it.</div><div><br></div><div>-When I am trying to insert my module, it fails to allocate 4MB memory using kmalloc.</div><div><br></div><div>-Below is a snapshot of <b>cat /proc/meminfo </b>command of my embedded linux system.</div><div><br></div><div><span>&lt;Selection_001.png&gt;</span><br></div><div><br></div><div>-According to my understanding, LowFree parameter indicates free memory in kernel space which is around 536MB in this case.</div><div><br></div><div>-There is a lot free space available in kernel space then&nbsp;</div><div>why module fails in kmalloc of 4MB ?</div><div><br></div><div>-Also find the attached log messages of dmesg</div><div><br></div><div>Regards,</div><div>Mehul</div></div>
</div><br></div>
<span>&lt;dmesg.log&gt;</span>_______________________________________________<br>Kernelnewbies mailing list<br><a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies<br></blockquote><br></div><div>My 2 Cents.<br><br>Your dmesg says it cannot allocate 2^10 * PAGESIZE (what ever the pagesize is).&nbsp;<br><br>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.<br><br>Thanks<br>Arshad</div><br></body></html>