Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1538702

Re: Lockdep splat from destroy_workqueue() with RT_PREEMPT_FULL

From John Keeping <john@metanate.com>
Newsgroups linux.kernel
Subject Re: Lockdep splat from destroy_workqueue() with RT_PREEMPT_FULL
Date 2016-12-08 17:30 +0100
Message-ID <sM9K4-8la-103@gated-at.bofh.it> (permalink)
References <sM6j8-6ce-5@gated-at.bofh.it> <sM75v-6GO-9@gated-at.bofh.it>
Organization Metanate Ltd

Show all headers | View raw


Hi Sebastian,

On Thu, 8 Dec 2016 14:33:06 +0100, Sebastian Andrzej Siewior wrote:
> On 2016-12-08 12:20:28 [+0000], John Keeping wrote:
> > 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?

Yes, I am able to reproduce it reasonably reliably, or at least I *was*
able to: since applying the patch below I haven't seen it fail at all,
so consider the patch:

Tested-by: John Keeping <john@metanate.com>


> 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();
>  	}
>  }


John

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Lockdep splat from destroy_workqueue() with RT_PREEMPT_FULL John Keeping <john@metanate.com> - 2016-12-08 13:50 +0100
  Re: Lockdep splat from destroy_workqueue() with RT_PREEMPT_FULL Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-12-08 14:40 +0100
    Re: Lockdep splat from destroy_workqueue() with RT_PREEMPT_FULL John Keeping <john@metanate.com> - 2016-12-08 17:30 +0100

csiph-web