mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Max Kellermann <mk@cm4all.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] sched: configure a lockdep class for rq->lock
Date: Mon, 28 Nov 2011 12:38:52 +0100	[thread overview]
Message-ID: <20111128113852.23015.88535.stgit@rabbit.intern.cm-ag> (raw)

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;


                 reply	other threads:[~2011-11-28 11:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111128113852.23015.88535.stgit@rabbit.intern.cm-ag \
    --to=mk@cm4all.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®