Skip to contentSkip to conversation

Documentation: statistics about nested locks

PATCH Superseded Juri Lelli 4 participants 6 messages May 16, 2011 – May 17, 2011 Documentation

lore
Share & tools
lore

Juri Lelli

author
#0 lore raw

PATCH 1/1 Documentation: statistics about nested locks

Hi all,
just a little patch to the Documentation. I had some trouble understanding the trailing "/1" on some lock class names of lock_stat output, so I added something on this inside lockstat documentation.

---
 Documentation/lockstat.txt |   36 ++++++++++++++++++++++++++++++++++--
 1 files changed, 34 insertions(+), 2 deletions(-)
Documentation/lockstat.txt +34 -2
index 65f4c79..75eeb65 100644
@@ -12,8 +12,9 @@ Because things like lock contention can severely impact performance.
 - HOW
 
 Lockdep already has hooks in the lock functions and maps lock instances to
-lock classes. We build on that. The graph below shows the relation between
-the lock functions and the various hooks therein.
+lock classes. We build on that (see Documentation/lockdep-design.txt).
+The graph below shows the relation between the lock functions and the various
+hooks therein.
 
         __acquire
             |
@@ -128,6 +129,37 @@ points are the points we're contending with.
 
 The integer part of the time values is in us.
 
+Dealing with nested locks, subclasses may appear:
+
+32...............................................................................................................................................................................................
+33
+34                               &rq->lock:         13128 13128           0.43         190.53      103881.26          97454 
 3453404           0.00         401.11    13224683.11
+35                               ---------
+36                               &rq->lock            645 [<ffffffff8103bfc4>] task_rq_lock+0x43/0x75
+37                               &rq->lock            297 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
+38                               &rq->lock            360 [<ffffffff8103c4c5>] select_task_rq_fair+0x1f0/0x74a
+39                               &rq->lock            428 [<ffffffff81045f98>] scheduler_tick+0x46/0x1fb
+40                               ---------
+41                               &rq->lock             77 [<ffffffff8103bfc4>] task_rq_lock+0x43/0x75
+42                               &rq->lock            174 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
+43                               &rq->lock           4715 [<ffffffff8103ed4b>] double_rq_lock+0x42/0x54
+44                               &rq->lock            893 [<ffffffff81340524>] schedule+0x157/0x7b8
+45
+46...............................................................................................................................................................................................
+47
+48                             &rq->lock/1:         11526 11488           0.33         388.73      136294.31          21461 
   38404           0.00          37.93      109388.53
+49                             -----------
+50                             &rq->lock/1          11526 [<ffffffff8103ed58>] double_rq_lock+0x4f/0x54
+51                             -----------
+52                             &rq->lock/1           5645 [<ffffffff8103ed4b>] double_rq_lock+0x42/0x54
+53                             &rq->lock/1           1224 [<ffffffff81340524>] schedule+0x157/0x7b8
+54                             &rq->lock/1           4336 [<ffffffff8103ed58>] double_rq_lock+0x4f/0x54
+55                             &rq->lock/1            181 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
+
+Line 48 shows statistics for the first subclass (/1) of &rq->lock class, since
+in this case, as line 50 suggests, double_rq_lock actually acquires a nested
+lock of two spinlocks.
+
 View the top contending locks:
 # grep : /proc/lock_stat | head
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 3 lines · Juri Lelli

+The graph below shows the relation between the lock functions and the various
+hooks therein.

That smells like the patch has whitespace damage..

#2 lore raw
Quoted 6 lines · Peter Zijlstra
Quoted 3 lines · Juri Lelli

+The graph below shows the relation between the lock functions and the various
+hooks therein.

That smells like the patch has whitespace damage..

Yeah, Documentation/email-clients.txt might help there.

Thanks,

Ingo

author
#3 lore raw

Sorry for my mistake with the email client and thanks for the hint! May I resend a (I hope) corrected version of this small patch with the revision made by Yong?

Quoted 10 lines · Ingo Molnar
Quoted 6 lines · Peter Zijlstra
Quoted 3 lines · Juri Lelli

+The graph below shows the relation between the lock functions and the various
+hooks therein.

That smells like the patch has whitespace damage..

Quoted 5 lines

Yeah, Documentation/email-clients.txt might help there.

Thanks,

Ingo

Thanks,

Juri

#4 lore raw
Quoted 3 lines · Juri Lelli

Sorry for my mistake with the email client and thanks for the hint! May I resend a (I hope) corrected version of this small patch with the revision made by Yong?

No problem on my side :)

Thanks,
Yong

Quoted 22 lines · Ingo Molnar
Quoted 10 lines · Peter Zijlstra
Quoted 7 lines · Juri Lelli
Quoted 3 lines

+The graph below shows the relation between the lock functions and the various
+hooks therein.

That smells like the patch has whitespace damage..

Quoted 5 lines

Yeah, Documentation/email-clients.txt might help there.

Thanks,

      Ingo

Thanks,

       Juri

Signature · 1 line
Only stand for myself
#5 lore raw
In reply to Juri Lelli
Quoted 76 lines · Juri Lelli

Hi all,
just a little patch to the Documentation. I had some trouble understanding the trailing "/1" on some lock class names of lock_stat output, so I added something on this inside lockstat documentation.

---
 Documentation/lockstat.txt |   36 ++++++++++++++++++++++++++++++++++--

 1 files changed, 34 insertions(+), 2 deletions(-)
Documentation/lockstat.txt +0 -0
index 65f4c79..75eeb65 100644
@@ -12,8 +12,9 @@ Because things like lock contention can severely impact

performance.
 - HOW

 Lockdep already has hooks in the lock functions and maps lock instances to

Documentation/lockstat.txt +2 -2
-lock classes. We build on that. The graph below shows the relation between
-the lock functions and the various hooks therein.
+lock classes. We build on that (see Documentation/lockdep-design.txt).
+The graph below shows the relation between the lock functions and the

various
+hooks therein.

        __acquire
            |

Documentation/lockstat.txt +0 -0
@@ -128,6 +129,37 @@ points are the points we're contending with.
 

 The integer part of the time values is in us.

Documentation/lockstat.txt +5 -0
+Dealing with nested locks, subclasses may appear:
+
+32...............................................................................................................................................................................................
+33
+34                               &rq->lock:         13128 13128

0.43         190.53      103881.26          97454  3453404           0.00
      401.11    13224683.11
+35                               ---------
+36                               &rq->lock            645
[<ffffffff8103bfc4>] task_rq_lock+0x43/0x75
+37                               &rq->lock            297
[<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
+38                               &rq->lock            360
[<ffffffff8103c4c5>] select_task_rq_fair+0x1f0/0x74a
+39                               &rq->lock            428
[<ffffffff81045f98>] scheduler_tick+0x46/0x1fb
+40                               ---------
+41                               &rq->lock             77
[<ffffffff8103bfc4>] task_rq_lock+0x43/0x75
+42                               &rq->lock            174
[<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
+43                               &rq->lock           4715
[<ffffffff8103ed4b>] double_rq_lock+0x42/0x54
+44                               &rq->lock            893
[<ffffffff81340524>] schedule+0x157/0x7b8
+45 +46............................................................................................................................................................................................... +47
+48                             &rq->lock/1:         11526 11488
0.33         388.73      136294.31          21461    38404           0.00
       37.93      109388.53
+49                             -----------
+50                             &rq->lock/1          11526
[<ffffffff8103ed58>] double_rq_lock+0x4f/0x54
+51                             -----------
+52                             &rq->lock/1           5645
[<ffffffff8103ed4b>] double_rq_lock+0x42/0x54
+53                             &rq->lock/1           1224
[<ffffffff81340524>] schedule+0x157/0x7b8
+54                             &rq->lock/1           4336
[<ffffffff8103ed58>] double_rq_lock+0x4f/0x54
+55                             &rq->lock/1            181
[<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a

Documentation/lockstat.txt

Quoted 2 lines
Documentation/lockstat.txt +2 -0
+
+Line 48 shows statistics for the first subclass (/1) of &rq->lock class,

Actually it's the second subclass because subclass starts from 0.

Thanks,
Yong

Quoted 11 lines

since
+in this case, as line 50 suggests, double_rq_lock actually acquires a nested

Documentation/lockstat.txt +2 -0
+lock of two spinlocks.
+

 View the top contending locks:

 # grep : /proc/lock_stat | head
--
1.7.4.1
Signature · 2 lines
Only stand for myself
���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m����������?�I�