public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Linux-pm mailing list <linux-pm@lists.linux-foundation.org>
Subject: Re: Singlethread vs. freezable workqueues
Date: Tue, 22 May 2007 00:54:09 +0400	[thread overview]
Message-ID: <20070521205409.GA167@tv-sign.ru> (raw)
In-Reply-To: <200705212154.34490.rjw@sisk.pl>

On 05/21, Rafael J. Wysocki wrote:
> 
> On Monday, 21 May 2007 21:33, Alan Stern wrote:
> > Raphael:
> > 
> > Are we now committed to making freezable workqueues always 
> > singlethreaded?  Is it at all likely to change back?  Or should I 
> > introduce a "create_singlethread_freezeable_workqueue" macro?
> 
> This was done as a quick fix of an issue with one driver that started to use
> (broken) freezable workqueues when we were not watching. ;-)
> 
> We are going to have multithread freezable workqueues as well, but that'll
> take some time.  We've discussed this a bit with Oleg and I believe he has an
> idea of how it can be done cleanly.

No, I don't have an idea how to do this cleanly currently.

We can fix them right now with Rafael's "take_over_work() + migrate_sequence"
patch, feel free to send it. Not perfect, but should work.

Perhaps it makes sense to make some other changes first. For example, kill
CPU_TASKS_FROZEN bit.

Next. We can't make all wqs freezeable, but if we add freezer_exempt/PF_FE_XXX
we can freeze them all for cpu_up/cpu_down, this also make things simpler.

Note that we don't have a good way to use take_over_work() for !freezeable wq.
2.6.21 does kthread_stop() first, this is deadlockable because we may have
a work_struct on ->worklist which also calls kthread_stop(). Perhaps it makes
sense to wait until kthread_stop() will be reworked (should be soon).

Perhaps we can think a bit more :)

Oleg.

  parent reply	other threads:[~2007-05-21 20:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-21 19:33 Singlethread vs. freezable workqueues Alan Stern
2007-05-21 19:54 ` Rafael J. Wysocki
2007-05-21 20:23   ` Alan Stern
2007-05-21 21:20     ` Rafael J. Wysocki
2007-05-22 12:45       ` Oleg Nesterov
2007-05-22 15:03         ` Alan Stern
2007-05-22 16:26           ` Oleg Nesterov
2007-05-21 20:54   ` Oleg Nesterov [this message]
2007-05-21 21:28     ` Rafael J. Wysocki

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=20070521205409.GA167@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=rjw@sisk.pl \
    /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