public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* lock_stat &rq->lock/1 class name meaning
@ 2011-05-11 16:26 Juri Lelli
  2011-05-12 10:57 ` Yong Zhang
  0 siblings, 1 reply; 5+ messages in thread
From: Juri Lelli @ 2011-05-11 16:26 UTC (permalink / raw)
  To: linux-kernel

Hi,
I'm trying to collect contention statistics through /proc/lock_stat 
about scheduler data structures.

What I obtain if a do "cat /proc/lock_stat" is something like:
...
&rq->lock:         13128          13128           0.43         190.53 
    103881.26          97454        3453404           0.00 
401.11    13224683.11
---------
&rq->lock            645          [<ffffffff8103bfc4>] 
task_rq_lock+0x43/0x75
&rq->lock            297          [<ffffffff8104ba65>] 
try_to_wake_up+0x127/0x25a
&rq->lock            360          [<ffffffff8103c4c5>] 
select_task_rq_fair+0x1f0/0x74a
&rq->lock            428          [<ffffffff81045f98>] 
scheduler_tick+0x46/0x1fb
---------
&rq->lock             77          [<ffffffff8103bfc4>] 
task_rq_lock+0x43/0x75
&rq->lock            174          [<ffffffff8104ba65>] 
try_to_wake_up+0x127/0x25a
&rq->lock           4715          [<ffffffff8103ed4b>] 
double_rq_lock+0x42/0x54
&rq->lock            893          [<ffffffff81340524>] schedule+0x157/0x7b8
.
.
.
...
&rq->lock/1:         11526          11488           0.33         388.73 
      136294.31          21461          38404           0.00 
37.93      109388.53
-----------
&rq->lock/1          11526          [<ffffffff8103ed58>] 
double_rq_lock+0x4f/0x54
-----------
&rq->lock/1           5645          [<ffffffff8103ed4b>] 
double_rq_lock+0x42/0x54
&rq->lock/1           1224          [<ffffffff81340524>] 
schedule+0x157/0x7b8
&rq->lock/1           4336          [<ffffffff8103ed58>] 
double_rq_lock+0x4f/0x54
&rq->lock/1            181          [<ffffffff8104ba65>] 
try_to_wake_up+0x127/0x25a

I guess the first one is about the per-rq (per-CPU) spinlock, but what 
about the second? What the "/1" stands for?
Since every rq has a different spinlock, does &rq->lock group numbers 
from all the runqueues?

Thanks a lot,
	Juri

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

* Re: lock_stat &rq->lock/1 class name meaning
  2011-05-11 16:26 lock_stat &rq->lock/1 class name meaning Juri Lelli
@ 2011-05-12 10:57 ` Yong Zhang
  2011-05-12 12:11   ` Juri Lelli
  0 siblings, 1 reply; 5+ messages in thread
From: Yong Zhang @ 2011-05-12 10:57 UTC (permalink / raw)
  To: Juri Lelli; +Cc: linux-kernel

On Wed, May 11, 2011 at 06:26:10PM +0200, Juri Lelli wrote:
> Hi,
> I'm trying to collect contention statistics through /proc/lock_stat
> about scheduler data structures.
> 
> What I obtain if a do "cat /proc/lock_stat" is something like:
> ...
> &rq->lock:         13128          13128           0.43
> 190.53    103881.26          97454        3453404           0.00
> 401.11    13224683.11
> ---------
> &rq->lock            645          [<ffffffff8103bfc4>]
> task_rq_lock+0x43/0x75
> &rq->lock            297          [<ffffffff8104ba65>]
> try_to_wake_up+0x127/0x25a
> &rq->lock            360          [<ffffffff8103c4c5>]
> select_task_rq_fair+0x1f0/0x74a
> &rq->lock            428          [<ffffffff81045f98>]
> scheduler_tick+0x46/0x1fb
> ---------
> &rq->lock             77          [<ffffffff8103bfc4>]
> task_rq_lock+0x43/0x75
> &rq->lock            174          [<ffffffff8104ba65>]
> try_to_wake_up+0x127/0x25a
> &rq->lock           4715          [<ffffffff8103ed4b>]
> double_rq_lock+0x42/0x54
> &rq->lock            893          [<ffffffff81340524>] schedule+0x157/0x7b8
> .
> .
> .
> ...
> &rq->lock/1:         11526          11488           0.33
> 388.73      136294.31          21461          38404           0.00
> 37.93      109388.53
> -----------
> &rq->lock/1          11526          [<ffffffff8103ed58>]
> double_rq_lock+0x4f/0x54
> -----------
> &rq->lock/1           5645          [<ffffffff8103ed4b>]
> double_rq_lock+0x42/0x54
> &rq->lock/1           1224          [<ffffffff81340524>]
> schedule+0x157/0x7b8
> &rq->lock/1           4336          [<ffffffff8103ed58>]
> double_rq_lock+0x4f/0x54
> &rq->lock/1            181          [<ffffffff8104ba65>]
> try_to_wake_up+0x127/0x25a
> 
> I guess the first one is about the per-rq (per-CPU) spinlock, but
> what about the second? What the "/1" stands for?

It is also rq but it's subclass is 1.

Take a look at raw_spin_lock_nested(&this_rq->lock, SINGLE_DEPTH_NESTING);
in _double_lock_balance()

> Since every rq has a different spinlock, does &rq->lock group
> numbers from all the runqueues?

Yup.

Thanks,
Yong

> 
> Thanks a lot,
> 	Juri
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: lock_stat &rq->lock/1 class name meaning
  2011-05-12 10:57 ` Yong Zhang
@ 2011-05-12 12:11   ` Juri Lelli
  2011-05-12 12:26     ` Yong Zhang
  0 siblings, 1 reply; 5+ messages in thread
From: Juri Lelli @ 2011-05-12 12:11 UTC (permalink / raw)
  To: Yong Zhang; +Cc: linux-kernel

Thanks!

On 05/12/2011 12:57 PM, Yong Zhang wrote:
> On Wed, May 11, 2011 at 06:26:10PM +0200, Juri Lelli wrote:
>> Hi,
>> I'm trying to collect contention statistics through /proc/lock_stat
>> about scheduler data structures.
>>
>> What I obtain if a do "cat /proc/lock_stat" is something like:
>> ...
>> &rq->lock:         13128          13128           0.43
>> [...]
>>
>> I guess the first one is about the per-rq (per-CPU) spinlock, but
>> what about the second? What the "/1" stands for?
>
> It is also rq but it's subclass is 1.
>
> Take a look at raw_spin_lock_nested(&this_rq->lock, SINGLE_DEPTH_NESTING);
> in _double_lock_balance()

Ok, I've put more light on this also looking at lockdep.h comments and 
lockdep-design documentation.

Since I'm probably not the only one having troubles undestanding 
lock_stat output, maybe could be useful to add something on this inside 
lockstat documentation (I can try to do this). What you think?

	Juri

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

* Re: lock_stat &rq->lock/1 class name meaning
  2011-05-12 12:11   ` Juri Lelli
@ 2011-05-12 12:26     ` Yong Zhang
  2011-05-12 14:22       ` Américo Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Yong Zhang @ 2011-05-12 12:26 UTC (permalink / raw)
  To: Juri Lelli; +Cc: linux-kernel, Peter Zijlstra, Ingo Molnar

On Thu, May 12, 2011 at 02:11:02PM +0200, Juri Lelli wrote:
> Thanks!
> 
> On 05/12/2011 12:57 PM, Yong Zhang wrote:
> >On Wed, May 11, 2011 at 06:26:10PM +0200, Juri Lelli wrote:
> >>Hi,
> >>I'm trying to collect contention statistics through /proc/lock_stat
> >>about scheduler data structures.
> >>
> >>What I obtain if a do "cat /proc/lock_stat" is something like:
> >>...
> >>&rq->lock:         13128          13128           0.43
> >>[...]
> >>
> >>I guess the first one is about the per-rq (per-CPU) spinlock, but
> >>what about the second? What the "/1" stands for?
> >
> >It is also rq but it's subclass is 1.
> >
> >Take a look at raw_spin_lock_nested(&this_rq->lock, SINGLE_DEPTH_NESTING);
> >in _double_lock_balance()
> 
> Ok, I've put more light on this also looking at lockdep.h comments
> and lockdep-design documentation.
> 
> Since I'm probably not the only one having troubles undestanding
> lock_stat output, maybe could be useful to add something on this
> inside lockstat documentation (I can try to do this). What you
> think?

Any improvement will be good :)

Cc'ing PeterZ and Ingo.

Thanks,
Yong

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

* Re: lock_stat &rq->lock/1 class name meaning
  2011-05-12 12:26     ` Yong Zhang
@ 2011-05-12 14:22       ` Américo Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Américo Wang @ 2011-05-12 14:22 UTC (permalink / raw)
  To: Yong Zhang; +Cc: Juri Lelli, linux-kernel, Peter Zijlstra, Ingo Molnar

On Thu, May 12, 2011 at 8:26 PM, Yong Zhang <yong.zhang0@gmail.com> wrote:
> On Thu, May 12, 2011 at 02:11:02PM +0200, Juri Lelli wrote:
>> Thanks!
>>
>> On 05/12/2011 12:57 PM, Yong Zhang wrote:
>> >On Wed, May 11, 2011 at 06:26:10PM +0200, Juri Lelli wrote:
>> >>Hi,
>> >>I'm trying to collect contention statistics through /proc/lock_stat
>> >>about scheduler data structures.
>> >>
>> >>What I obtain if a do "cat /proc/lock_stat" is something like:
>> >>...
>> >>&rq->lock:         13128          13128           0.43
>> >>[...]
>> >>
>> >>I guess the first one is about the per-rq (per-CPU) spinlock, but
>> >>what about the second? What the "/1" stands for?
>> >
>> >It is also rq but it's subclass is 1.
>> >
>> >Take a look at raw_spin_lock_nested(&this_rq->lock, SINGLE_DEPTH_NESTING);
>> >in _double_lock_balance()
>>
>> Ok, I've put more light on this also looking at lockdep.h comments
>> and lockdep-design documentation.
>>
>> Since I'm probably not the only one having troubles undestanding
>> lock_stat output, maybe could be useful to add something on this
>> inside lockstat documentation (I can try to do this). What you
>> think?
>
> Any improvement will be good :)

I think Documentation/lockstat.txt is out of date,
the last change of this file can be back to
Thu Nov 19 13:54:05 2009.

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

end of thread, other threads:[~2011-05-12 14:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-11 16:26 lock_stat &rq->lock/1 class name meaning Juri Lelli
2011-05-12 10:57 ` Yong Zhang
2011-05-12 12:11   ` Juri Lelli
2011-05-12 12:26     ` Yong Zhang
2011-05-12 14:22       ` Américo Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox