Commit f62508f68d04adefc4cf9b0177ba02c8818b3eec

Authored by Juri Lelli
Committed by Ingo Molnar
1 parent dc7acbb251

Documentation: Add statistics about nested locks

Explain what the trailing "/1" on some lock class names of
lock_stat output means.

Reviewed-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Juri Lelli <juri.lelli@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/4DD4F6C1.5090701@gmail.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 1 changed file with 34 additions and 2 deletions Side-by-side Diff

Documentation/lockstat.txt
... ... @@ -12,8 +12,9 @@
12 12 - HOW
13 13  
14 14 Lockdep already has hooks in the lock functions and maps lock instances to
15   -lock classes. We build on that. The graph below shows the relation between
16   -the lock functions and the various hooks therein.
  15 +lock classes. We build on that (see Documentation/lockdep-design.txt).
  16 +The graph below shows the relation between the lock functions and the various
  17 +hooks therein.
17 18  
18 19 __acquire
19 20 |
... ... @@ -127,6 +128,37 @@
127 128 points are the points we're contending with.
128 129  
129 130 The integer part of the time values is in us.
  131 +
  132 +Dealing with nested locks, subclasses may appear:
  133 +
  134 +32...............................................................................................................................................................................................
  135 +33
  136 +34 &rq->lock: 13128 13128 0.43 190.53 103881.26 97454 3453404 0.00 401.11 13224683.11
  137 +35 ---------
  138 +36 &rq->lock 645 [<ffffffff8103bfc4>] task_rq_lock+0x43/0x75
  139 +37 &rq->lock 297 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
  140 +38 &rq->lock 360 [<ffffffff8103c4c5>] select_task_rq_fair+0x1f0/0x74a
  141 +39 &rq->lock 428 [<ffffffff81045f98>] scheduler_tick+0x46/0x1fb
  142 +40 ---------
  143 +41 &rq->lock 77 [<ffffffff8103bfc4>] task_rq_lock+0x43/0x75
  144 +42 &rq->lock 174 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
  145 +43 &rq->lock 4715 [<ffffffff8103ed4b>] double_rq_lock+0x42/0x54
  146 +44 &rq->lock 893 [<ffffffff81340524>] schedule+0x157/0x7b8
  147 +45
  148 +46...............................................................................................................................................................................................
  149 +47
  150 +48 &rq->lock/1: 11526 11488 0.33 388.73 136294.31 21461 38404 0.00 37.93 109388.53
  151 +49 -----------
  152 +50 &rq->lock/1 11526 [<ffffffff8103ed58>] double_rq_lock+0x4f/0x54
  153 +51 -----------
  154 +52 &rq->lock/1 5645 [<ffffffff8103ed4b>] double_rq_lock+0x42/0x54
  155 +53 &rq->lock/1 1224 [<ffffffff81340524>] schedule+0x157/0x7b8
  156 +54 &rq->lock/1 4336 [<ffffffff8103ed58>] double_rq_lock+0x4f/0x54
  157 +55 &rq->lock/1 181 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
  158 +
  159 +Line 48 shows statistics for the second subclass (/1) of &rq->lock class
  160 +(subclass starts from 0), since in this case, as line 50 suggests,
  161 +double_rq_lock actually acquires a nested lock of two spinlocks.
130 162  
131 163 View the top contending locks:
132 164