linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Tejun Heo <tj@kernel.org>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>,
	linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 1/2] workqueue: skip lockdep wq dependency in cancel_work_sync()
Date: Tue, 21 Aug 2018 19:30:21 +0200	[thread overview]
Message-ID: <1534872621.25523.39.camel@sipsolutions.net> (raw)
In-Reply-To: <20180821172711.GR3978217@devbig004.ftw2.facebook.com> (sfid-20180821_192716_762024_DE7C68A2)

Hi,

> On Tue, Aug 21, 2018 at 07:18:14PM +0200, Johannes Berg wrote:
> > > But this can lead to a deadlock.  I'd much rather err on the side of
> > > discouraging complex lock dancing around ordered workqueues, no?
> > 
> > What can lead to a deadlock?
> 
> Oh not this particular case, but I was wondering whether we'd be
> missing legitimate possible deadlock cases by skipping lockdep for all
> cancel_work_sync()'s as they can actually flush.

I don't see how? This is only relevant in ordered/single-threaded WQs,
but even there it doesn't matter doesn't matter as explained?

I'm actually seeing a false positive report from lockdep, because it
*is* flushing, i.e. I'm running into the case of the work actually
running, i.e. the "_sync" part of "cancel_work_sync()" is kicking in,
but in that case a single-threaded WQ can't have anything executing
*before* it, so we don't need to generate a lockdep dependency - and in
fact don't *want* to create one to avoid the false positive.

I'm not really sure what you think we might be missing? Am I missing
some case where cancel_work_sync() can possibly deadlock? Apart from the
issue I addressed in the second patch, obviously.

johannes

  reply	other threads:[~2018-08-21 20:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-21 12:03 [PATCH 0/2] workqueue lockdep limitations/bugs Johannes Berg
2018-08-21 12:03 ` [PATCH 1/2] workqueue: skip lockdep wq dependency in cancel_work_sync() Johannes Berg
2018-08-21 16:08   ` Tejun Heo
2018-08-21 17:18     ` Johannes Berg
2018-08-21 17:27       ` Tejun Heo
2018-08-21 17:30         ` Johannes Berg [this message]
2018-08-21 17:55           ` Tejun Heo
2018-08-21 19:20             ` Johannes Berg
2018-08-22  2:45               ` Byungchul Park
2018-08-22  4:02                 ` Johannes Berg
2018-08-22  5:47                   ` Byungchul Park
2018-08-22  7:07                     ` Johannes Berg
2018-08-22  7:50                       ` Byungchul Park
2018-08-22  8:02                         ` Johannes Berg
2018-08-22  9:15                           ` Byungchul Park
2018-08-22  9:42                             ` Johannes Berg
2018-08-22 12:47                               ` Byungchul Park
2018-08-21 12:03 ` [PATCH 2/2] workqueue: create lockdep dependency in flush_work() Johannes Berg
2018-08-21 16:09   ` Tejun Heo
2018-08-21 17:19     ` Johannes Berg
2018-08-21 16:00 ` [PATCH 0/2] workqueue lockdep limitations/bugs Tejun Heo
2018-08-21 17:15   ` Johannes Berg

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=1534872621.25523.39.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --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).