From: Tejun Heo <tj@kernel.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: workqueue_set_max_active(wq, 0)?
Date: Fri, 9 Dec 2011 08:57:02 -0800 [thread overview]
Message-ID: <20111209165702.GD12108@google.com> (raw)
In-Reply-To: <1323424482.3622.8.camel@jlt3.sipsolutions.net>
Hello, Johannes. :)
On Fri, Dec 09, 2011 at 10:54:42AM +0100, Johannes Berg wrote:
> And then I found workqueue_set_max_active() but passing 0 isn't allowed.
>
> Before I dive in more deeply I figured I'd ask if you think what a good
> way of doing this would be (and whether I'm completely insane) :-)
Hmmm... yeah, actually, that's what wq uses internally to implement
freezable workqueues. It sets max_active to 0 temporarily and waits
for all in-flight works to finish. On thaw, the original value is
restored.
Updating workqueue_set_max_active() to return the old value would be a
nice API update which goes together, I think.
Thanks.
--
tejun
next prev parent reply other threads:[~2011-12-09 16:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-09 9:54 Johannes Berg
2011-12-09 16:57 ` Tejun Heo [this message]
2011-12-09 16:59 ` Johannes Berg
2011-12-15 15:38 ` Johannes Berg
2011-12-15 18:35 ` Tejun Heo
2011-12-15 18:43 ` Johannes Berg
2011-12-15 19:12 ` Tejun Heo
2011-12-15 19:26 ` Johannes Berg
2011-12-15 19:31 ` Tejun Heo
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=20111209165702.GD12108@google.com \
--to=tj@kernel.org \
--cc=johannes@sipsolutions.net \
--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
Powered by JetHome