Re: Spinlock debugging

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

 



Hi,

Bahadir Balban a écrit :

> My approach is to spot and fix the problem reading the code, rather
> than searching for clues at run-time. Do you have any suggestions to
> what to look for in the code this way?

Make sure each spin_lock() has a corresponding spin_unlock(), even on
error cases:

spin_lock();
ret = foobar();
if (ret < 0) {
   spin_unlock();     /* Don't forget this one */
   return ret;
}
ret = barfoo();
spin_unlock();
return ret;

If you still don't find, post your code or its URL.

Sincerly,

Thomas
-- 
Thomas Petazzoni
thomas.petazzoni@xxxxxxxx


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[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