2008-08-25 21:49:32

by Joe Korty

[permalink] [raw]
Subject: [PATCH] lockstat - repair erronous contention statistics

Fix bad contention counting in /proc/lock_stat.

/proc/lockstat tries to gather per-ip contention
statistics per-lock. This was failing due to
a garbage per-ip index selector being used.

Index: 2.6.26/kernel/lockdep.c
===================================================================
--- 2.6.26.orig/kernel/lockdep.c 2008-07-13 17:51:29.000000000 -0400
+++ 2.6.26/kernel/lockdep.c 2008-08-25 17:00:15.000000000 -0400
@@ -2791,7 +2791,7 @@

stats = get_lock_stats(hlock->class);
if (point < ARRAY_SIZE(stats->contention_point))
- stats->contention_point[i]++;
+ stats->contention_point[point]++;
if (lock->cpu != smp_processor_id())
stats->bounces[bounce_contended + !!hlock->read]++;
put_lock_stats(stats);


2008-08-26 08:41:21

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH] lockstat - repair erronous contention statistics


* Joe Korty <[email protected]> wrote:

> Fix bad contention counting in /proc/lock_stat.
>
> /proc/lockstat tries to gather per-ip contention
> statistics per-lock. This was failing due to
> a garbage per-ip index selector being used.

applied to tip/core/urgent, thanks Joe.

Ingo

2008-08-26 08:47:18

by Peter Zijlstra

[permalink] [raw]
Subject: Re: [PATCH] lockstat - repair erronous contention statistics

On Tue, 2008-08-26 at 10:41 +0200, Ingo Molnar wrote:
> * Joe Korty <[email protected]> wrote:
>
> > Fix bad contention counting in /proc/lock_stat.
> >
> > /proc/lockstat tries to gather per-ip contention
> > statistics per-lock. This was failing due to
> > a garbage per-ip index selector being used.
>
> applied to tip/core/urgent, thanks Joe.

Ack, weird I remember having fixed this before, -rt even has this fix
included.. /me kicks himself