lkml.org 
[lkml]   [2011]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] sched: configure a lockdep class for rq->lock
From
Date
This fixes the warning that disables lockdep at runtime:

INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.

Signed-off-by: Max Kellermann <mk@cm4all.com>
---
kernel/sched.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index b50b0f0..57f9b37 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -574,6 +574,8 @@ struct rq {
#endif
};

+static struct lock_class_key rq_lock_class;
+
static DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);


@@ -8077,6 +8079,7 @@ void __init sched_init(void)

rq = cpu_rq(i);
raw_spin_lock_init(&rq->lock);
+ lockdep_set_class(&rq->lock, &rq_lock_class);
rq->nr_running = 0;
rq->calc_load_active = 0;
rq->calc_load_update = jiffies + LOAD_FREQ;


\
 
 \ /
  Last update: 2011-11-28 12:39    [W:0.132 / U:0.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site