<div class="gmail_quote">On Wed, Aug 31, 2011 at 2:17 PM, Daniel Baluta <span dir="ltr"><<a href="mailto:daniel.baluta@gmail.com">daniel.baluta@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello,<br>
<div><div></div><div class="h5">> i wrote a linux kernel module which uses mmap_sem in lots of places. I grab<br>
> mmap_sem for both reads & writes. And, i also use page_table_lock spinlock<br>
> under them. The problem i have is that there is a hard to reproduce a race<br>
> condition bug in which a thread doesn't release the semaphore at all. Hence,<br>
> ps hangs as ps needs to grab mmap_sem for the processes. The question is how<br>
> do i find the thread that is holding the semaphore forever. It will help me<br>
> figure out the part of the code the race is in.<br>
> So, the question is : I have some number of threads grabbing the semaphore<br>
> for read/write. One of them grabs it & doesn't release at all. How do i find<br>
> the thread that is holding it. This is not a soft lockup & i dont get any<br>
> hung_task_timeout messages.<br>
> Any help is appreciated.<br>
<br>
</div></div>You could turn on lockdep (LOCKDEP_SUPPORT=y),<br>
and see if any warnings are triggered.<br></blockquote><div>LOCKDEP_SUPPORT is turned on in my kernel but I dont see any warnings. </div><div><br></div><div>Thanks though.</div><div><br></div><div>Venkatram</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
thanks,<br>
<font color="#888888">Daniel.<br>
</font></blockquote></div><br>