All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: lkp@lists.01.org
Subject: Re: [lockdep] ef9db2383c7: WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:3538 check_flags+0x22d/0x240()
Date: Wed, 18 Mar 2015 10:12:36 +0100	[thread overview]
Message-ID: <20150318091236.GL23123@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1426666507.5570.32.camel@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1228 bytes --]

On Wed, Mar 18, 2015 at 04:15:07PM +0800, Huang Ying wrote:
> [    0.043211] ------------[ cut here ]------------
> [    0.043778] WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:3538 check_flags+0x22d/0x240()
> [    0.044000] DEBUG_LOCKS_WARN_ON(current->hardirqs_enabled)

> [    0.044000]  [<ffffffff8111659d>] check_flags+0x22d/0x240
> [    0.044000]  [<ffffffff81117636>] lock_is_held+0x36/0x90
> [    0.044000]  [<ffffffff81129ce5>] rcu_read_lock_held+0x65/0x70
> [    0.044000]  [<ffffffff81117d16>] lockdep_init_map+0x336/0x6f0

I'm not entirely sure how we get from lockdep_init_map() into
rcu_read_lock_held() without going through another call like
is_module_address().

But the error is clear enough; I added the below on top of this patch.

Thanks!

---
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -2996,8 +2996,13 @@ void lockdep_init_map(struct lockdep_map
 	if (subclass) {
 		unsigned long flags;
 
+		if (DEBUG_LOCKS_WARN_ON(current->lockdep_recursion))
+			return;
+
 		raw_local_irq_save(flags);
+		current->lockdep_recursion = 1;
 		register_lock_class(lock, subclass, 1);
+		current->lockdep_recursion = 0;
 		raw_local_irq_restore(flags);
 	}
 }

WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <peterz@infradead.org>
To: Huang Ying <ying.huang@intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>, LKP ML <lkp@01.org>
Subject: Re: [LKP] [lockdep] ef9db2383c7: WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:3538 check_flags+0x22d/0x240()
Date: Wed, 18 Mar 2015 10:12:36 +0100	[thread overview]
Message-ID: <20150318091236.GL23123@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1426666507.5570.32.camel@intel.com>

On Wed, Mar 18, 2015 at 04:15:07PM +0800, Huang Ying wrote:
> [    0.043211] ------------[ cut here ]------------
> [    0.043778] WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:3538 check_flags+0x22d/0x240()
> [    0.044000] DEBUG_LOCKS_WARN_ON(current->hardirqs_enabled)

> [    0.044000]  [<ffffffff8111659d>] check_flags+0x22d/0x240
> [    0.044000]  [<ffffffff81117636>] lock_is_held+0x36/0x90
> [    0.044000]  [<ffffffff81129ce5>] rcu_read_lock_held+0x65/0x70
> [    0.044000]  [<ffffffff81117d16>] lockdep_init_map+0x336/0x6f0

I'm not entirely sure how we get from lockdep_init_map() into
rcu_read_lock_held() without going through another call like
is_module_address().

But the error is clear enough; I added the below on top of this patch.

Thanks!

---
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -2996,8 +2996,13 @@ void lockdep_init_map(struct lockdep_map
 	if (subclass) {
 		unsigned long flags;
 
+		if (DEBUG_LOCKS_WARN_ON(current->lockdep_recursion))
+			return;
+
 		raw_local_irq_save(flags);
+		current->lockdep_recursion = 1;
 		register_lock_class(lock, subclass, 1);
+		current->lockdep_recursion = 0;
 		raw_local_irq_restore(flags);
 	}
 }

  reply	other threads:[~2015-03-18  9:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-18  8:15 [lockdep] ef9db2383c7: WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:3538 check_flags+0x22d/0x240() Huang Ying
2015-03-18  8:15 ` [LKP] " Huang Ying
2015-03-18  9:12 ` Peter Zijlstra [this message]
2015-03-18  9:12   ` Peter Zijlstra

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=20150318091236.GL23123@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=lkp@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.