From: Ingo Molnar Date: Mon, 3 Jul 2006 07:25:10 +0000 (-0700) Subject: [PATCH] lockdep: annotate scheduler runqueue locks X-Git-Tag: v2.6.18-rc1~60 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcb993712f231a4faea8393513d1276170679107;p=linux-2.6 [PATCH] lockdep: annotate scheduler runqueue locks Teach per-CPU runqueue locks and recursive locking code to the lock validator. Has no effect on non-lockdep kernels. Signed-off-by: Ingo Molnar Signed-off-by: Arjan van de Ven Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/sched.c b/kernel/sched.c index ae4db0185b..f4778d1aef 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -266,6 +266,7 @@ struct runqueue { unsigned long ttwu_cnt; unsigned long ttwu_local; #endif + struct lock_class_key rq_lock_key; }; static DEFINE_PER_CPU(struct runqueue, runqueues); @@ -6656,6 +6657,7 @@ void __init sched_init(void) rq = cpu_rq(i); spin_lock_init(&rq->lock); + lockdep_set_class(&rq->lock, &rq->rq_lock_key); rq->nr_running = 0; rq->active = rq->arrays; rq->expired = rq->arrays + 1;