The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Tejun Heo <tj@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: workqueue_set_max_active(wq, 0)?
Date: Fri, 09 Dec 2011 17:59:23 +0100	[thread overview]
Message-ID: <1323449963.3622.20.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <20111209165702.GD12108@google.com> (sfid-20111209_175740_727764_F62FADDC)

Hi Tejun,

> > 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.

Right, it's a little more complicated though because it has to wait etc.

> Updating workqueue_set_max_active() to return the old value would be a
> nice API update which goes together, I think.

Yeah, that would probably be useful, in particular if one tries to
freeze a paused workqueue...

johannes


  reply	other threads:[~2011-12-09 16:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09  9:54 workqueue_set_max_active(wq, 0)? Johannes Berg
2011-12-09 16:57 ` Tejun Heo
2011-12-09 16:59   ` Johannes Berg [this message]
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=1323449963.3622.20.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-kernel@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