Thread (4 messages) 4 messages, 3 authors, 2011-08-31

Kernel Lock Debugging

From: Venkatram Tummala <hidden>
Date: 2011-08-31 21:35:16

On Wed, Aug 31, 2011 at 2:17 PM, Daniel Baluta [off-list ref]wrote:
Hello,
quoted
i wrote a linux kernel module which uses mmap_sem in lots of places. I
grab
quoted
mmap_sem for both reads & writes.  And, i also use page_table_lock
spinlock
quoted
under them. The problem i have is that there is a hard to reproduce a
race
quoted
condition bug in which a thread doesn't release the semaphore at all.
Hence,
quoted
ps hangs as ps needs to grab mmap_sem for the processes. The question is
how
quoted
do i find the thread that is holding the semaphore forever. It will help
me
quoted
figure out the part of the code the race is in.
So, the question is : I have some number of threads grabbing the
semaphore
quoted
for read/write. One of them grabs it & doesn't release at all. How do i
find
quoted
the thread that is holding it. This is not a soft lockup & i dont get any
hung_task_timeout messages.
Any help is appreciated.
You could turn on lockdep (LOCKDEP_SUPPORT=y),
and see if any warnings are triggered.
LOCKDEP_SUPPORT is turned on in my kernel but I dont see any warnings.

Thanks though.

Venkatram
thanks,
Daniel.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110831/0d7258a1/attachment.html 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help