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


Groups > linux.kernel > #1654559

Re: single-threaded wq lockdep is broken

From Johannes Berg <johannes@sipsolutions.net>
Newsgroups linux.kernel
Subject Re: single-threaded wq lockdep is broken
Date 2017-05-31 21:20 +0200
Message-ID <tNhjX-sJ-3@gated-at.bofh.it> (permalink)
References <tMccF-6e4-1@gated-at.bofh.it> <tNgxA-8mG-27@gated-at.bofh.it> <tNhjX-sJ-5@gated-at.bofh.it> <tNgxA-8mG-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Tejun,

> On Sun, May 28, 2017 at 09:33:13PM +0200, Johannes Berg wrote:
> > I suspect this is a long-standing bug introduced by all the pool
> > rework
> > you did at some point, but I don't really know nor can I figure out
> > how
> > to fix it right now. I guess it could possibly also be a lockdep
> > issue,
> > or an issue in how it's used, but I definitely know that this used
> > to
> > work (i.e. warn) back when I introduced the lockdep checking to the
> > WQ
> 
> Hah, didn't know this worked.

Ah, it was nice when I made this work - but you won't believe the
number of times I had to answer the question "what does this mean?" :-)

> So, it used to always create dependency between work items on
> singlethread workqueues according to their queeing order?  It
> shouldn't be difficult to fix.  I'll dig through the history and see
> what happened.

No, queuing order is (was) irrelevant, and I'm not sure it should
really matter all that much, since you often can't really predict
queueing order. It used to be that this triggered a lot on the
system_wq, which of course is no longer single-threaded so I suppose it
can make progress even in situations like this?

It basically just did a dependency of wq->work, work->mutex (according
to my code) and mutex->wq due to the flush.

I think that perhaps the last dependency of mutex->wq is lost now due
to flush_work()? Or perhaps there's something with the read/write thing
that caused this issue.

johannes

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


Thread

single-threaded wq lockdep is broken Johannes Berg <johannes@sipsolutions.net> - 2017-05-28 21:40 +0200
  Re: single-threaded wq lockdep is broken Lai Jiangshan <jiangshanlai@gmail.com> - 2017-05-31 10:40 +0200
    Re: single-threaded wq lockdep is broken Johannes Berg <johannes@sipsolutions.net> - 2017-05-31 10:40 +0200
      Re: single-threaded wq lockdep is broken Johannes Berg <johannes@sipsolutions.net> - 2017-05-31 10:50 +0200
      Re: single-threaded wq lockdep is broken Lai Jiangshan <jiangshanlai@gmail.com> - 2017-06-02 09:10 +0200
        Re: single-threaded wq lockdep is broken Johannes Berg <johannes@sipsolutions.net> - 2017-06-02 11:00 +0200
  Re: single-threaded wq lockdep is broken Tejun Heo <tj@kernel.org> - 2017-05-31 20:30 +0200
    Re: single-threaded wq lockdep is broken Johannes Berg <johannes@sipsolutions.net> - 2017-05-31 21:20 +0200

csiph-web