Re: Kernel Lock Debugging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Thu, Sep 1, 2011 at 3:05 AM, Venkatram Tummala <venkatram867@xxxxxxxxx> wrote:
On Wed, Aug 31, 2011 at 2:17 PM, Daniel Baluta <daniel.baluta@xxxxxxxxx> wrote:
Hello,
> i wrote a linux kernel module which uses mmap_sem in lots of places. I grab
> mmap_sem for both reads & writes.  And, i also use page_table_lock spinlock
> under them. The problem i have is that there is a hard to reproduce a race
> condition bug in which a thread doesn't release the semaphore at all. Hence,
> ps hangs as ps needs to grab mmap_sem for the processes. The question is how
> do i find the thread that is holding the semaphore forever. It will help me
> figure out the part of the code the race is in.
> So, the question is : I have some number of threads grabbing the semaphore
> for read/write. One of them grabs it & doesn't release at all. How do i find
> 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. 

 
Hi Venkatram,

Probably you could try using 'make menuconfig' before building the kernel and enabling some of the lockdep related stuff under the kernel hacking section.
There might be more config options necessary to be set in order to make use of lockdep than just LOCKDEP_SUPPORT.
The above method will help you enable all the necessary options.

Regards,
Srivatsa S. Bhat
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux