public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] workqueue: Keep activate-order equals to queue_work()-order
Date: Wed, 19 Sep 2012 10:31:28 -0700	[thread overview]
Message-ID: <20120919173128.GJ8474@google.com> (raw)
In-Reply-To: <505996F8.1020506@cn.fujitsu.com>

Hello, Lai.

On Wed, Sep 19, 2012 at 05:57:12PM +0800, Lai Jiangshan wrote:
> (disorder of execution is OK for current WQ. because we can launch new worker
> to execute the next work if the previous one is waiting something)
> 
> But I concern activate-order, not execution order. A non-delayed work
> may delay a delayed work for ever, and if a non-delayed work needs something
> which will be produced by delayed one, the two work may wait each other.
> 
> {
> a subsystem queues a work to release resource.
> and them
> a subsystem queues a work to use the resource.
> }
> Is this behavior acceptable?

Even on workqueues with a rescuer, forward progress is not guaranteed
if there are more than one co-dependent work items.  workqueue doesn't
guarantee anything regarding activation or execution order and any
user which depends on that is broken.

In general, I think it's a bad idea to give that kind of guarantee and
encourage such usages which can lead to extremely subtle breakages
which cannot be detected in any automated way - we don't have any way
to mark dependencies among work items.

Thanks.

-- 
tejun

      reply	other threads:[~2012-09-19 17:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18  8:36 [PATCH 1/2] workqueue: intruduce cwq_set_max_active() helper for thaw_workqueues() Lai Jiangshan
2012-09-18  8:36 ` [PATCH 2/2] workqueue: Keep activate-order equals to queue_work()-order Lai Jiangshan
2012-09-18 17:05   ` Tejun Heo
2012-09-18 17:08     ` Tejun Heo
2012-09-19 10:13       ` Lai Jiangshan
2012-09-19 17:42         ` Tejun Heo
2012-09-19  9:57     ` Lai Jiangshan
2012-09-19 17:31       ` Tejun Heo [this message]

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=20120919173128.GJ8474@google.com \
    --to=tj@kernel.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.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