<div dir="ltr"><div><div>Dear Arun,<br><br>typedef struct raw_spinlock {<br> arch_spinlock_t raw_lock;<br>#ifdef CONFIG_GENERIC_LOCKBREAK<br> unsigned int break_lock;<br>#endif<br>#ifdef CONFIG_DEBUG_SPINLOCK<br> unsigned int magic, owner_cpu;<br> void *owner;<br>#endif<br>#ifdef CONFIG_DEBUG_LOCK_ALLOC<br> struct lockdep_map dep_map;<br>#endif<br>} raw_spinlock_t;<br><br><br></div>Unfortunately, CONFIG_DEBUG_SPINLOCK is disabled on my sw. So i do not have this information. :(<br><br></div>Any other way?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 27, 2015 at 3:12 PM, Arun KS <span dir="ltr"><<a href="mailto:getarunks@gmail.com" target="_blank">getarunks@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 Manty,<br>
<div><div class="h5"><br>
On Tue, Jan 27, 2015 at 11:27 AM, manty kuma <<a href="mailto:mantykuma@gmail.com">mantykuma@gmail.com</a>> wrote:<br>
><br>
> Hi All,<br>
><br>
> Currently I am looking into an issue which is holding the printk lock(logbuf_lock)<br>
><br>
> logbuf_lock = {<br>
> raw_lock = {<br>
> owner = 0,<br>
> next = 4<br>
> }<br>
> }<br>
><br>
> I read about ticketing spinlocks to understand the above output. I understood that 4 cpu's are waiting for the lock while someone already has it.<br>
><br>
> I would like to know who has it? Is there a way I can know which process is acquiring a given spinlock? Is the information not stored in it?<br>
><br>
> I am using crash tool to analyse the dump<br>
<br>
<br>
</div></div>crash> raw_spinlock_t<br>
typedef struct raw_spinlock {<br>
arch_spinlock_t raw_lock;<br>
unsigned int magic;<br>
unsigned int owner_cpu;<br>
void *owner;<br>
} raw_spinlock_t;<br>
SIZE: 16<br>
<br>
The owner field points to task holding the lock, if locked.<br>
<br>
Here is what i have in one of my dumps,<br>
crash> logbuf_lock<br>
logbuf_lock = $6 = {<br>
raw_lock = {<br>
{<br>
slock = 464001960,<br>
tickets = {<br>
owner = 7080,<br>
next = 7080<br>
}<br>
}<br>
},<br>
magic = 3735899821,<br>
owner_cpu = 4294967295,<br>
owner = 0xffffffff<br>
}<br>
<br>
since lock is not acquired, it shows 0xFFFFFFFF.<br>
Otherwise point to a task_struct *.<br>
<br>
thanks,<br>
Arun<br>
<br>
><br>
><br>
> Regards,<br>
> Manty<br>
><br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
><br>
</blockquote></div><br></div>