linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: John Keeping <john@metanate.com>
Cc: linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	linux-rt-users@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: Lockdep splat from destroy_workqueue() with RT_PREEMPT_FULL
Date: Thu, 8 Dec 2016 14:33:06 +0100	[thread overview]
Message-ID: <20161208133306.254xkj2d4a2c24yr@linutronix.de> (raw)
In-Reply-To: <20161208122028.18e7b9e1.john@metanate.com>

On 2016-12-08 12:20:28 [+0000], John Keeping wrote:
> Hi,
Hi John,

> I am seeing the following splat when stopping btattach on v4.4.30-rt41
> with PREEMPT_RT_FULL with lockdep and slub_debug.
> 
> The bad unlock balance seems to just be an effect of the lock having
> been overwritten with POISON_FREE, the real issue is that
> put_pwq_unlocked() is not resuming and unlocking the pool before the RCU
> work scheduled indirectly by put_pwq() has completed.

can you reproduce this? If so, is this patch helping?

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1135,9 +1135,11 @@ static void put_pwq_unlocked(struct pool_workqueue *pwq)
 		 * As both pwqs and pools are RCU protected, the
 		 * following lock operations are safe.
 		 */
+		rcu_read_lock();
 		local_spin_lock_irq(pendingb_lock, &pwq->pool->lock);
 		put_pwq(pwq);
 		local_spin_unlock_irq(pendingb_lock, &pwq->pool->lock);
+		rcu_read_unlock();
 	}
 }
 

Sebastian

  reply	other threads:[~2016-12-08 13:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08 12:20 Lockdep splat from destroy_workqueue() with RT_PREEMPT_FULL John Keeping
2016-12-08 13:33 ` Sebastian Andrzej Siewior [this message]
2016-12-08 16:25   ` John Keeping

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=20161208133306.254xkj2d4a2c24yr@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=jiangshanlai@gmail.com \
    --cc=john@metanate.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tj@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;
as well as URLs for NNTP newsgroup(s).