All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: 0day robot <lkp@intel.com>, LKML <linux-kernel@vger.kernel.org>,
	lkp@lists.01.org, kernel test robot <oliver.sang@intel.com>
Subject: Re: [PATCH] workqueue: Use private WQ for schedule_on_each_cpu() API
Date: Wed, 23 Feb 2022 12:29:01 -1000	[thread overview]
Message-ID: <Yha1LeX4OK3cLCV5@slm.duckdns.org> (raw)
In-Reply-To: <9a883d72-ea7d-1936-93e6-5c2a290509d4@I-love.SAKURA.ne.jp>

On Thu, Feb 24, 2022 at 07:26:30AM +0900, Tetsuo Handa wrote:
> > The patch seems pretty wrong. What's problematic is system workqueue flushes
> > (which flushes the entire workqueue), not work item flushes.
> 
> Why? My understanding is that
> 
>   flushing a workqueue waits for completion of all work items in that workqueue
> 
>   flushing a work item waits for for completion of that work item using
>   a workqueue specified as of queue_work()
> 
> and
> 
>   if a work item in some workqueue is blocked by other work in that workqueue
>   (e.g. max_active limit, work items on that workqueue and locks they need),
>   it has a risk of deadlock
> 
> . Then, how can flushing a work item using system-wide workqueues be free of deadlock risk?
> Isn't it just "unlikely to deadlock" rather than "impossible to deadlock"?

If we're jamming system_wq with a combination of work items which need more
than max_active to make forward progress, we're stuck regardless of flushes.
What's needed at that point is increasing max_active (or something along
that line).

Thanks.

-- 
tejun

WARNING: multiple messages have this Message-ID (diff)
From: Tejun Heo <tj@kernel.org>
To: lkp@lists.01.org
Subject: Re: [PATCH] workqueue: Use private WQ for schedule_on_each_cpu() API
Date: Wed, 23 Feb 2022 12:29:01 -1000	[thread overview]
Message-ID: <Yha1LeX4OK3cLCV5@slm.duckdns.org> (raw)
In-Reply-To: <9a883d72-ea7d-1936-93e6-5c2a290509d4@I-love.SAKURA.ne.jp>

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

On Thu, Feb 24, 2022 at 07:26:30AM +0900, Tetsuo Handa wrote:
> > The patch seems pretty wrong. What's problematic is system workqueue flushes
> > (which flushes the entire workqueue), not work item flushes.
> 
> Why? My understanding is that
> 
>   flushing a workqueue waits for completion of all work items in that workqueue
> 
>   flushing a work item waits for for completion of that work item using
>   a workqueue specified as of queue_work()
> 
> and
> 
>   if a work item in some workqueue is blocked by other work in that workqueue
>   (e.g. max_active limit, work items on that workqueue and locks they need),
>   it has a risk of deadlock
> 
> . Then, how can flushing a work item using system-wide workqueues be free of deadlock risk?
> Isn't it just "unlikely to deadlock" rather than "impossible to deadlock"?

If we're jamming system_wq with a combination of work items which need more
than max_active to make forward progress, we're stuck regardless of flushes.
What's needed at that point is increasing max_active (or something along
that line).

Thanks.

-- 
tejun

  reply	other threads:[~2022-02-23 22:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21  8:33 [workqueue] 29bd199e4e: WARNING:possible_circular_locking_dependency_detected kernel test robot
2022-02-21  8:33 ` kernel test robot
2022-02-21 10:38 ` [PATCH] workqueue: Use private WQ for schedule_on_each_cpu() API Tetsuo Handa
2022-02-21 10:38   ` Tetsuo Handa
2022-02-22 17:29   ` Tejun Heo
2022-02-22 17:29     ` Tejun Heo
2022-02-23  0:57     ` Tetsuo Handa
2022-02-23  0:57       ` Tetsuo Handa
2022-02-23 21:33       ` Tejun Heo
2022-02-23 21:33         ` Tejun Heo
2022-02-23 22:26         ` Tetsuo Handa
2022-02-23 22:26           ` Tetsuo Handa
2022-02-23 22:29           ` Tejun Heo [this message]
2022-02-23 22:29             ` Tejun Heo
2022-02-28 14:03             ` [PATCH v3] workqueue: Warn flushing of kernel-global workqueues Tetsuo Handa
2022-02-28 14:03               ` Tetsuo Handa
2022-02-28 18:42               ` Tejun Heo
2022-02-28 18:42                 ` Tejun Heo
2022-03-17 22:25                 ` Tetsuo Handa
2022-03-17 22:25                   ` Tetsuo Handa

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=Yha1LeX4OK3cLCV5@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=lkp@lists.01.org \
    --cc=oliver.sang@intel.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    /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.