<br><div class="gmail_quote">On Thu, Sep 1, 2011 at 3:05 AM, Venkatram Tummala <span dir="ltr"><<a href="mailto:venkatram867@gmail.com">venkatram867@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div class="im">On Wed, Aug 31, 2011 at 2:17 PM, Daniel Baluta <span dir="ltr"><<a href="mailto:daniel.baluta@gmail.com" target="_blank">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>> 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><div>LOCKDEP_SUPPORT is turned on in my kernel but I dont see any warnings. </div><div><br></div></div></blockquote><div> </div><div>Hi Venkatram,<br><br>Probably you could try using 'make menuconfig' before building the kernel and enabling some of the lockdep related stuff under the kernel hacking section.<br>
There might be more config options necessary to be set in order to make use of lockdep than just LOCKDEP_SUPPORT. <br>The above method will help you enable all the necessary options.<br><br>Regards,<br>Srivatsa S. Bhat <br>
</div></div>