lkml.org 
[lkml]   [2011]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectContinuous mmap & unmap of kernel buffers leading to memory leak on linux kernel 2.6.38
Hi,
I have a driver that supports mmap of kernel buffers to the user space.
The user space application continuously mmaps and unmaps lot of memory.
This piece of code works fine on linux kernel 2.6.9 while same code gives huge memory leaks on linux kernel 2.6.38 finally leading to system memory allocation failure.
I am suspecting that the mmap’ed pages are not getting unmapped at all.

The nopage() routine (fault() routine for linux kernel version >= 2.6.26) of the vma operations increments the page count of the page that has been requested/accessed before returning the required page.
As I am seeing it, on linux kernel 2.6.9, when the vmaclose() routine gets called, the page count in 2.6.9 kernel is ‘0’ while in 2.6.38 it is ‘1’.
To my knowledge, the unmap routine itself decrements the page count of each of the pages. But, somehow for 2.6.38, the page count is ‘1’ even when the vmaclose() routine gets called.
I even tried decrementing the page count in vmaclose() routine for 2.6.38 kernel. But, the memory leak continues.

Am I missing something here or has something changed in the linux kernel in this path?

Thanks & Regards
Ganesh Jaju.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-07-04 12:11    [W:0.024 / U:1.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site