Re: [RESEND PATCH] Documentation: statistics about nested locks

From: Yong Zhang
Date: Thu May 19 2011 - 21:20:40 EST


On Thu, May 19, 2011 at 6:53 PM, Juri Lelli <juri.lelli@xxxxxxxxx> wrote:
> Explain what the trailing "/1" on some lock class names of lock_stat output
> means.
>
> Cc: Yong Zhang <yong.zhang0@xxxxxxxxx>
> Signed-off-by: Juri Lelli <juri.lelli@xxxxxxxxx>
>

Looks good.

Reviewed-by: Yong Zhang <yong.zhang0@xxxxxxxxx>

> ---
> ÂDocumentation/lockstat.txt | Â 36 ++++++++++++++++++++++++++++++++++--
> Â1 files changed, 34 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/lockstat.txt b/Documentation/lockstat.txt
> index 65f4c79..75eeb65 100644
> --- a/Documentation/lockstat.txt
> +++ b/Documentation/lockstat.txt
> @@ -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 second subclass (/1) of &rq->lock class
> +(subclass starts from 0), 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
> --
> 1.7.4.1
>



--
Only stand for myself
èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébëæìr¸›zX§»®w¥Š{ayºÊÚë,j­¢f£¢·hš‹àz¹®w¥¢¸ ¢·¦j:+v‰¨ŠwèjØm¶Ÿÿ¾«‘êçzZ+ƒùšŽŠÝj"ú!¶iO•æ¬z·švØ^¶m§ÿðà nÆàþY&—