Memory Leak
Hi All
I am using consistent_alloc () to allocate consistent memory for DMA. When
I free the buffers using consistent_free(), the /proc/meminfo shows a memory leak of the buffer size allocated.
I have attached a module code to allocate memory when inserted and free when removed. The memory leak can be found using the command cat/proc/meminfo.
Also the consistent_alloc call gives an error something like "Kernel bug at
cachemap.." if we try to allocate more than 2MB.
Can anyone help me in solving these issues
Thanking you in advance
Regards
Aman
Quoted 8 lines · Aman
Hi All
I am usingconsistent_alloc() to allocate consistent memory for DMA. When
I free the buffers usingconsistent_free(), the/proc/meminfoshows a memory leak of the buffer size allocated.I have attached a module code to allocate memory when inserted and free when removed. The memory leak can be found using the command cat
/proc/meminfo.
This was fixed three months ago in the development trees.
Quoted 2 lines
Also the
consistent_alloccall gives an error something like "Kernel bug at
cachemap.." if we try to allocate more than 2MB.
Of course, MAX_ORDER is 10 (in 2.4) and consistent_alloc() is based on __get_free_pages().
I suggest reading "Understanding the Linux Kernel", "Linux Device Drivers", and Documentation/* as a starting point for kernel development.
If you simply must have more consistent memory then you can use mem= on the command line to reduce the memory available to the kernel and then use __ioremap/consistent_sync to map the massive buffer and make it consistent.
Regards,
--
Matt Porter
[email protected]
This is Linux Country. On a quiet night, you can hear Windows reboot.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/