All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Cartwright <joshc@ni.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "Luis Claudio R. Goncalves" <lclaudio@uudg.org>,
	linux-rt-users@vger.kernel.org
Subject: Re: [4.4.4-rt11] Possiblie recursive locking detected in kswapd / mb_cache_shrink_scan()
Date: Mon, 21 Mar 2016 09:40:16 -0500	[thread overview]
Message-ID: <20160321144016.GA31276@jcartwri.amer.corp.natinst.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1603190933150.3978@nanos>

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

On Sat, Mar 19, 2016 at 09:33:34AM +0100, Thomas Gleixner wrote:
> On Mon, 14 Mar 2016, Luis Claudio R. Goncalves wrote:
> 
> > Hello,
> > 
> > I just started using 4.4.4-rt11 this afternoon and saw the lockdep splat below.
> > Is this something new or did I miss a patch floating on the list?
> 
> That's new. Looking into it.

It looks like the way that INIT_HLIST_BL_HEAD() is authored, all
instances of the contained raw spinlock will share the same lockdep
class.  That, coupled with the following in mb_cache_shrink(), is
triggering the lockdep violation:

	void
	mb_cache_shrink(struct block_device *bdev)
	{
		[..]
				/*
				 * Prevent any find or get operation on the entry.
				 */
				hlist_bl_lock(ce->e_block_hash_p);
				hlist_bl_lock(ce->e_index_hash_p);

  Josh

diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h
index 44f0b55..d13428a 100644
--- a/include/linux/list_bl.h
+++ b/include/linux/list_bl.h
@@ -42,13 +42,18 @@ struct hlist_bl_node {
 	struct hlist_bl_node *next, **pprev;
 };
 
-static inline void INIT_HLIST_BL_HEAD(struct hlist_bl_head *h)
-{
-	h->first = NULL;
 #ifdef CONFIG_PREEMPT_RT_BASE
-	raw_spin_lock_init(&h->lock);
+#define INIT_HLIST_BL_HEAD(h)		\
+do {					\
+	(h)->first = NULL;		\
+	raw_spin_lock_init(&(h)->lock);	\
+} while (0)
+#else
+#define INIT_HLIST_BL_HEAD(h)		\
+do {					\
+	(h)->first = NULL;		\
+} while (0)
 #endif
-}
 
 static inline void INIT_HLIST_BL_NODE(struct hlist_bl_node *h)
 {

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  parent reply	other threads:[~2016-03-21 14:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-14 21:00 [4.4.4-rt11] Possiblie recursive locking detected in kswapd / mb_cache_shrink_scan() Luis Claudio R. Goncalves
2016-03-19  8:33 ` Thomas Gleixner
2016-03-21 13:34   ` Luis Claudio R. Goncalves
2016-03-21 14:40   ` Josh Cartwright [this message]
2016-03-21 20:47     ` Luis Claudio R. Goncalves
2016-03-29 15:04     ` Sebastian Andrzej Siewior
2016-03-29 18:20       ` Josh Cartwright
2016-03-29 23:14         ` Josh Cartwright
2016-03-30  8:16           ` Sebastian Andrzej Siewior
2016-03-31  5:04             ` [PATCH] list_bl: fixup bogus lockdep warning Josh Cartwright
2016-04-01 10:46               ` Sebastian Andrzej Siewior
2016-04-01 10:49               ` Sebastian Andrzej Siewior
2016-04-01 17:02                 ` Josh Cartwright

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=20160321144016.GA31276@jcartwri.amer.corp.natinst.com \
    --to=joshc@ni.com \
    --cc=lclaudio@uudg.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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.