From: Tejun Heo <tj@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: Harald Geyer <harald@ccbib.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] workqueue: Add new function mod_fwd_delayed_work()
Date: Mon, 6 Mar 2017 17:22:12 -0500 [thread overview]
Message-ID: <20170306222212.GM26127@htj.duckdns.org> (raw)
In-Reply-To: <20170223173449.c747nrfr3oxrjrr7@sirena.org.uk>
Hello,
On Thu, Feb 23, 2017 at 09:34:49AM -0800, Mark Brown wrote:
> It is *very* non-obvious that mod_delayed_work() will have a problem
> from the documentation, there's "mod_delayed_work_on() on local CPU" as
> the body of the description but honestly I'm struggling to tell if
> that's even there intentionally or anything other than an implementation
> detail. I'd expect to see some words describing the situations where it
> can be used or something, both the name and the lack of any information
> about issues suggest it's the default thing and will work safely.
What the mod function is implemneting is "whoever wins (runs the last)
determines the timeout". It is a bit unwiedly because unlike the
timer, workqueue delay takes duration instead of the absoulte time
making coordinating from the user side trickier.
> > I was suprised when I found that no function like mod_fwd_delayed_work()
> > existed, so you have a point there.
>
> I suspect people are just using mod_delayed_work(), not realising that
> there are restrictions. I'm thinking that perhaps it should be fixed
> to be safe for calling from different contexts and a new function with
> the existing behaviour added, that seems less error prone.
I don't think it's a matter of "fixing" the existing
mod_delayed_work(). What the new function is implementing wouldn't
fit use cases where the timeout should only be shortened (IIRC,
writeback code does that).
I'm not against adding new interface to handle it better but I think
it makes more sense to add both directions. How about adding
expedite_delayed_work_on() and postpone_delayed_work_on()?
Thanks.
--
tejun
next prev parent reply other threads:[~2017-03-06 22:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-22 17:41 [PATCH 1/2] workqueue: Add new function mod_fwd_delayed_work() Harald Geyer
2017-02-22 17:41 ` [PATCH 2/2] regulator: core: Fix race on multiple calls to regulator_disable_deferred() Harald Geyer
2017-02-22 18:21 ` [PATCH 1/2] workqueue: Add new function mod_fwd_delayed_work() Mark Brown
2017-02-22 20:06 ` Harald Geyer
2017-02-23 17:34 ` Mark Brown
2017-02-23 23:22 ` Harald Geyer
2017-02-27 12:54 ` Mark Brown
2017-02-27 19:17 ` Harald Geyer
2017-03-07 12:42 ` Mark Brown
2017-03-10 18:44 ` Harald Geyer
2017-03-06 22:22 ` Tejun Heo [this message]
2017-03-07 11:29 ` Harald Geyer
2017-03-07 19:16 ` Tejun Heo
2017-03-07 12:45 ` Mark Brown
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=20170306222212.GM26127@htj.duckdns.org \
--to=tj@kernel.org \
--cc=broonie@kernel.org \
--cc=harald@ccbib.org \
--cc=jiangshanlai@gmail.com \
--cc=lgirdwood@gmail.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