diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-10-15 17:00:10 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-10-15 17:00:10 +0200 |
commit | b8efb56172bc55082b8490778b07ef73eea0b551 (patch) | |
tree | 2d70e91af4cbd470904ebb4e28ad558c29e73092 /kernel/sched.c | |
parent | de8d585a12aef40676f12ddc63e97daaf7752ba1 (diff) | |
download | op-kernel-dev-b8efb56172bc55082b8490778b07ef73eea0b551.zip op-kernel-dev-b8efb56172bc55082b8490778b07ef73eea0b551.tar.gz |
sched debug: BKL usage statistics
add per task and per rq BKL usage statistics.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index f33608e..5004dff 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -356,6 +356,9 @@ struct rq { /* try_to_wake_up() stats */ unsigned long ttwu_cnt; unsigned long ttwu_local; + + /* BKL stats */ + unsigned long bkl_cnt; #endif struct lock_class_key rq_lock_key; }; @@ -3414,6 +3417,12 @@ static inline void schedule_debug(struct task_struct *prev) profile_hit(SCHED_PROFILING, __builtin_return_address(0)); schedstat_inc(this_rq(), sched_cnt); +#ifdef CONFIG_SCHEDSTATS + if (unlikely(prev->lock_depth >= 0)) { + schedstat_inc(this_rq(), bkl_cnt); + schedstat_inc(prev, sched_info.bkl_cnt); + } +#endif } /* |