All of lore.kernel.org
 help / color / mirror / Atom feed
* Ticketing spinlocks - How to get to the owner who locked the spinlock?
@ 2015-01-27  5:57 manty kuma
  2015-01-27  6:12 ` Arun KS
  2015-01-27  6:17 ` sanjeev sharma
  0 siblings, 2 replies; 7+ messages in thread
From: manty kuma @ 2015-01-27  5:57 UTC (permalink / raw)
  To: kernelnewbies

Hi All,

Currently I am looking into an issue which is holding the printk
lock(logbuf_lock)

logbuf_lock = {
  raw_lock = {
    owner = 0,
    next = 4
  }
}

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.

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?

I am using crash tool to analyse the dump

Regards,
Manty
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150127/a0b667be/attachment.html 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Ticketing spinlocks - How to get to the owner who locked the spinlock?
  2015-01-27  5:57 Ticketing spinlocks - How to get to the owner who locked the spinlock? manty kuma
@ 2015-01-27  6:12 ` Arun KS
  2015-01-27  6:22   ` manty kuma
  2015-01-27  6:17 ` sanjeev sharma
  1 sibling, 1 reply; 7+ messages in thread
From: Arun KS @ 2015-01-27  6:12 UTC (permalink / raw)
  To: kernelnewbies

Hello Manty,

On Tue, Jan 27, 2015 at 11:27 AM, manty kuma <mantykuma@gmail.com> wrote:
>
> Hi All,
>
> Currently I am looking into an issue which is holding the printk lock(logbuf_lock)
>
> logbuf_lock = {
>   raw_lock = {
>     owner = 0,
>     next = 4
>   }
> }
>
> 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.
>
> 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?
>
> I am using crash tool to analyse the dump


crash> raw_spinlock_t
typedef struct raw_spinlock {
    arch_spinlock_t raw_lock;
    unsigned int magic;
    unsigned int owner_cpu;
    void *owner;
} raw_spinlock_t;
SIZE: 16

The owner field points to task holding the lock, if locked.

Here is what i have in one of my dumps,
crash> logbuf_lock
logbuf_lock = $6 = {
  raw_lock = {
    {
      slock = 464001960,
      tickets = {
        owner = 7080,
        next = 7080
      }
    }
  },
  magic = 3735899821,
  owner_cpu = 4294967295,
  owner = 0xffffffff
}

since lock is not acquired, it shows 0xFFFFFFFF.
Otherwise point to a task_struct *.

thanks,
Arun

>
>
> Regards,
> Manty
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Ticketing spinlocks - How to get to the owner who locked the spinlock?
  2015-01-27  5:57 Ticketing spinlocks - How to get to the owner who locked the spinlock? manty kuma
  2015-01-27  6:12 ` Arun KS
@ 2015-01-27  6:17 ` sanjeev sharma
  2015-01-27  6:23   ` manty kuma
  1 sibling, 1 reply; 7+ messages in thread
From: sanjeev sharma @ 2015-01-27  6:17 UTC (permalink / raw)
  To: kernelnewbies

Hello

you can try to print running task backtrack information in kernel/lockdep.c

Regards
Sanjeev Sharma

On Tue, Jan 27, 2015 at 11:27 AM, manty kuma <mantykuma@gmail.com> wrote:

> Hi All,
>
> Currently I am looking into an issue which is holding the printk
> lock(logbuf_lock)
>
> logbuf_lock = {
>   raw_lock = {
>     owner = 0,
>     next = 4
>   }
> }
>
> 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.
>
> 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?
>
> I am using crash tool to analyse the dump
>
> Regards,
> Manty
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150127/56512e02/attachment.html 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Ticketing spinlocks - How to get to the owner who locked the spinlock?
  2015-01-27  6:12 ` Arun KS
@ 2015-01-27  6:22   ` manty kuma
  2015-01-27  6:25     ` Arun KS
  0 siblings, 1 reply; 7+ messages in thread
From: manty kuma @ 2015-01-27  6:22 UTC (permalink / raw)
  To: kernelnewbies

Dear Arun,

typedef struct raw_spinlock {
    arch_spinlock_t raw_lock;
#ifdef CONFIG_GENERIC_LOCKBREAK
    unsigned int break_lock;
#endif
#ifdef CONFIG_DEBUG_SPINLOCK
    unsigned int magic, owner_cpu;
    void *owner;
#endif
#ifdef CONFIG_DEBUG_LOCK_ALLOC
    struct lockdep_map dep_map;
#endif
} raw_spinlock_t;


Unfortunately, CONFIG_DEBUG_SPINLOCK is disabled on my sw. So i do not have
this information. :(

Any other way?

On Tue, Jan 27, 2015 at 3:12 PM, Arun KS <getarunks@gmail.com> wrote:

> Hello Manty,
>
> On Tue, Jan 27, 2015 at 11:27 AM, manty kuma <mantykuma@gmail.com> wrote:
> >
> > Hi All,
> >
> > Currently I am looking into an issue which is holding the printk
> lock(logbuf_lock)
> >
> > logbuf_lock = {
> >   raw_lock = {
> >     owner = 0,
> >     next = 4
> >   }
> > }
> >
> > 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.
> >
> > 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?
> >
> > I am using crash tool to analyse the dump
>
>
> crash> raw_spinlock_t
> typedef struct raw_spinlock {
>     arch_spinlock_t raw_lock;
>     unsigned int magic;
>     unsigned int owner_cpu;
>     void *owner;
> } raw_spinlock_t;
> SIZE: 16
>
> The owner field points to task holding the lock, if locked.
>
> Here is what i have in one of my dumps,
> crash> logbuf_lock
> logbuf_lock = $6 = {
>   raw_lock = {
>     {
>       slock = 464001960,
>       tickets = {
>         owner = 7080,
>         next = 7080
>       }
>     }
>   },
>   magic = 3735899821,
>   owner_cpu = 4294967295,
>   owner = 0xffffffff
> }
>
> since lock is not acquired, it shows 0xFFFFFFFF.
> Otherwise point to a task_struct *.
>
> thanks,
> Arun
>
> >
> >
> > Regards,
> > Manty
> >
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies at kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150127/05865fb6/attachment.html 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Ticketing spinlocks - How to get to the owner who locked the spinlock?
  2015-01-27  6:17 ` sanjeev sharma
@ 2015-01-27  6:23   ` manty kuma
  0 siblings, 0 replies; 7+ messages in thread
From: manty kuma @ 2015-01-27  6:23 UTC (permalink / raw)
  To: kernelnewbies

Thank you Sanjeev,

But as of now i am not sure on how to reproduce the issue. So i have to
deal with the dump.

Regards,
Manty

On Tue, Jan 27, 2015 at 3:17 PM, sanjeev sharma <sanjeevsharmaengg@gmail.com
> wrote:

> Hello
>
> you can try to print running task backtrack information in kernel/lockdep.c
>
> Regards
> Sanjeev Sharma
>
> On Tue, Jan 27, 2015 at 11:27 AM, manty kuma <mantykuma@gmail.com> wrote:
>
>> Hi All,
>>
>> Currently I am looking into an issue which is holding the printk
>> lock(logbuf_lock)
>>
>> logbuf_lock = {
>>   raw_lock = {
>>     owner = 0,
>>     next = 4
>>   }
>> }
>>
>> 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.
>>
>> 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?
>>
>> I am using crash tool to analyse the dump
>>
>> Regards,
>> Manty
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies at kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150127/e93b5edf/attachment.html 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Ticketing spinlocks - How to get to the owner who locked the spinlock?
  2015-01-27  6:22   ` manty kuma
@ 2015-01-27  6:25     ` Arun KS
  2015-01-27  6:53       ` manty kuma
  0 siblings, 1 reply; 7+ messages in thread
From: Arun KS @ 2015-01-27  6:25 UTC (permalink / raw)
  To: kernelnewbies

Hi Manty,

On Tue, Jan 27, 2015 at 11:52 AM, manty kuma <mantykuma@gmail.com> wrote:
> Dear Arun,
>
> typedef struct raw_spinlock {
>     arch_spinlock_t raw_lock;
> #ifdef CONFIG_GENERIC_LOCKBREAK
>     unsigned int break_lock;
> #endif
> #ifdef CONFIG_DEBUG_SPINLOCK
>     unsigned int magic, owner_cpu;
>     void *owner;
> #endif
> #ifdef CONFIG_DEBUG_LOCK_ALLOC
>     struct lockdep_map dep_map;
> #endif
> } raw_spinlock_t;
>
>
> Unfortunately, CONFIG_DEBUG_SPINLOCK is disabled on my sw. So i do not have
> this information. :(
>
> Any other way?
What is the output from your runq command?


Thanks,
Arun
>
> On Tue, Jan 27, 2015 at 3:12 PM, Arun KS <getarunks@gmail.com> wrote:
>>
>> Hello Manty,
>>
>> On Tue, Jan 27, 2015 at 11:27 AM, manty kuma <mantykuma@gmail.com> wrote:
>> >
>> > Hi All,
>> >
>> > Currently I am looking into an issue which is holding the printk
>> > lock(logbuf_lock)
>> >
>> > logbuf_lock = {
>> >   raw_lock = {
>> >     owner = 0,
>> >     next = 4
>> >   }
>> > }
>> >
>> > 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.
>> >
>> > 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?
>> >
>> > I am using crash tool to analyse the dump
>>
>>
>> crash> raw_spinlock_t
>> typedef struct raw_spinlock {
>>     arch_spinlock_t raw_lock;
>>     unsigned int magic;
>>     unsigned int owner_cpu;
>>     void *owner;
>> } raw_spinlock_t;
>> SIZE: 16
>>
>> The owner field points to task holding the lock, if locked.
>>
>> Here is what i have in one of my dumps,
>> crash> logbuf_lock
>> logbuf_lock = $6 = {
>>   raw_lock = {
>>     {
>>       slock = 464001960,
>>       tickets = {
>>         owner = 7080,
>>         next = 7080
>>       }
>>     }
>>   },
>>   magic = 3735899821,
>>   owner_cpu = 4294967295,
>>   owner = 0xffffffff
>> }
>>
>> since lock is not acquired, it shows 0xFFFFFFFF.
>> Otherwise point to a task_struct *.
>>
>> thanks,
>> Arun
>>
>> >
>> >
>> > Regards,
>> > Manty
>> >
>> > _______________________________________________
>> > Kernelnewbies mailing list
>> > Kernelnewbies at kernelnewbies.org
>> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>> >
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Ticketing spinlocks - How to get to the owner who locked the spinlock?
  2015-01-27  6:25     ` Arun KS
@ 2015-01-27  6:53       ` manty kuma
  0 siblings, 0 replies; 7+ messages in thread
From: manty kuma @ 2015-01-27  6:53 UTC (permalink / raw)
  To: kernelnewbies

7 swappers and one process with name doe:handler

In pawapper processes aswell, when i see the backtrace i see some
 mem aborts but couldnot get to the place which is holding the lock

On Tuesday, January 27, 2015, Arun KS <getarunks@gmail.com> wrote:

> Hi Manty,
>
> On Tue, Jan 27, 2015 at 11:52 AM, manty kuma <mantykuma@gmail.com
> <javascript:;>> wrote:
> > Dear Arun,
> >
> > typedef struct raw_spinlock {
> >     arch_spinlock_t raw_lock;
> > #ifdef CONFIG_GENERIC_LOCKBREAK
> >     unsigned int break_lock;
> > #endif
> > #ifdef CONFIG_DEBUG_SPINLOCK
> >     unsigned int magic, owner_cpu;
> >     void *owner;
> > #endif
> > #ifdef CONFIG_DEBUG_LOCK_ALLOC
> >     struct lockdep_map dep_map;
> > #endif
> > } raw_spinlock_t;
> >
> >
> > Unfortunately, CONFIG_DEBUG_SPINLOCK is disabled on my sw. So i do not
> have
> > this information. :(
> >
> > Any other way?
> What is the output from your runq command?
>
>
> Thanks,
> Arun
> >
> > On Tue, Jan 27, 2015 at 3:12 PM, Arun KS <getarunks@gmail.com
> <javascript:;>> wrote:
> >>
> >> Hello Manty,
> >>
> >> On Tue, Jan 27, 2015 at 11:27 AM, manty kuma <mantykuma@gmail.com
> <javascript:;>> wrote:
> >> >
> >> > Hi All,
> >> >
> >> > Currently I am looking into an issue which is holding the printk
> >> > lock(logbuf_lock)
> >> >
> >> > logbuf_lock = {
> >> >   raw_lock = {
> >> >     owner = 0,
> >> >     next = 4
> >> >   }
> >> > }
> >> >
> >> > 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.
> >> >
> >> > 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?
> >> >
> >> > I am using crash tool to analyse the dump
> >>
> >>
> >> crash> raw_spinlock_t
> >> typedef struct raw_spinlock {
> >>     arch_spinlock_t raw_lock;
> >>     unsigned int magic;
> >>     unsigned int owner_cpu;
> >>     void *owner;
> >> } raw_spinlock_t;
> >> SIZE: 16
> >>
> >> The owner field points to task holding the lock, if locked.
> >>
> >> Here is what i have in one of my dumps,
> >> crash> logbuf_lock
> >> logbuf_lock = $6 = {
> >>   raw_lock = {
> >>     {
> >>       slock = 464001960,
> >>       tickets = {
> >>         owner = 7080,
> >>         next = 7080
> >>       }
> >>     }
> >>   },
> >>   magic = 3735899821,
> >>   owner_cpu = 4294967295,
> >>   owner = 0xffffffff
> >> }
> >>
> >> since lock is not acquired, it shows 0xFFFFFFFF.
> >> Otherwise point to a task_struct *.
> >>
> >> thanks,
> >> Arun
> >>
> >> >
> >> >
> >> > Regards,
> >> > Manty
> >> >
> >> > _______________________________________________
> >> > Kernelnewbies mailing list
> >> > Kernelnewbies at kernelnewbies.org <javascript:;>
> >> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150127/f927423a/attachment-0001.html 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-01-27  6:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-27  5:57 Ticketing spinlocks - How to get to the owner who locked the spinlock? manty kuma
2015-01-27  6:12 ` Arun KS
2015-01-27  6:22   ` manty kuma
2015-01-27  6:25     ` Arun KS
2015-01-27  6:53       ` manty kuma
2015-01-27  6:17 ` sanjeev sharma
2015-01-27  6:23   ` manty kuma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.