All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srivatsa Vaddagiri <vatsa@in.ibm.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>, Gautham R Shenoy <ego@in.ibm.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	LKML <linux-kernel@vger.kernel.org>,
	Oleg Nesterov <oleg@tv-sign.ru>
Subject: Re: Problem with freezable workqueues
Date: Wed, 28 Feb 2007 18:47:21 +0530	[thread overview]
Message-ID: <20070228131721.GD15509@in.ibm.com> (raw)
In-Reply-To: <200702281211.04515.rjw@sisk.pl>

On Wed, Feb 28, 2007 at 12:11:03PM +0100, Rafael J. Wysocki wrote:
> > In addition to thawing worker thread before kthread_stopping it, there
> > are minor changes required in worker threads, to check for
> > is_cpu_offline(bind_cpu) when they come out of refrigerator and jump to
> > wait_to_die if so (ex: softirq.c).
> > 
> > I guess you would need these changes before freezer-based hotplug is
> > merged, in which case Gautham can send those patches out first.
> 
> Yes, please, if that's possible.

After looking at the current workqueue code, the above minor change I
suggested is not required.

So you should be able to fix your "kthread_stop on a frozen worker
thread hangs" problem by just a simple patch like this (against
2.6.20-mm2):


--- workqueue.c.org	2007-02-28 18:32:48.000000000 +0530
+++ workqueue.c	2007-02-28 18:44:23.000000000 +0530
@@ -718,6 +718,8 @@ static void cleanup_workqueue_thread(str
 		insert_wq_barrier(cwq, &barr, 1);
 		cwq->should_stop = 1;
 		alive = 1;
+		if (frozen(cwq->thread))
+			thaw(cwq->thread);
 	}
 	spin_unlock_irq(&cwq->lock);
 

Can you test with this?

Note that as Oleg commented, freezable workqueues are broken w/o his
patch here:

	http://marc.theaimsgroup.com/?l=linux-kernel&m=116855740612755	

So you need to have Andrew/Linux pick up the above patch first to have
correctly functioning freezable workqueues.

-- 
Regards,
vatsa

  reply	other threads:[~2007-02-28 13:17 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-27 21:51 Problem with freezable workqueues Rafael J. Wysocki
2007-02-27 23:28 ` Oleg Nesterov
2007-02-27 23:36   ` Johannes Berg
2007-02-28  0:00     ` Rafael J. Wysocki
2007-02-28  0:00       ` Johannes Berg
2007-02-28 18:06     ` Gautham R Shenoy
2007-02-27 23:57   ` Rafael J. Wysocki
2007-02-28  0:01     ` Johannes Berg
2007-02-28  0:08       ` Rafael J. Wysocki
2007-02-28  1:14         ` Nigel Cunningham
2007-02-28 10:59           ` Rafael J. Wysocki
2007-02-28 20:36           ` Johannes Berg
2007-02-28  3:07     ` Srivatsa Vaddagiri
2007-02-28  8:48       ` Oleg Nesterov
2007-02-28  9:10         ` Srivatsa Vaddagiri
2007-02-28  9:43           ` Oleg Nesterov
2007-02-28 11:09           ` Rafael J. Wysocki
2007-02-28 18:17       ` Gautham R Shenoy
2007-02-28 18:41         ` Rafael J. Wysocki
2007-02-28  8:54     ` Pavel Machek
2007-02-28  3:01 ` Srivatsa Vaddagiri
2007-02-28  3:51   ` Srivatsa Vaddagiri
2007-02-28 11:11     ` Rafael J. Wysocki
2007-02-28 13:17       ` Srivatsa Vaddagiri [this message]
2007-02-28 13:27         ` Srivatsa Vaddagiri
2007-02-28 17:41           ` Rafael J. Wysocki
2007-02-28 17:40         ` Rafael J. Wysocki
2007-02-28 19:17         ` Rafael J. Wysocki
2007-02-28 19:32           ` Oleg Nesterov
2007-02-28 19:43             ` Rafael J. Wysocki
2007-02-28 20:08               ` Oleg Nesterov
2007-02-28 20:25                 ` Rafael J. Wysocki
2007-02-28 20:35                   ` Oleg Nesterov
2007-02-28 22:39                     ` Rafael J. Wysocki
2007-02-28 22:44                       ` Pavel Machek
2007-02-28 23:54                         ` [PATCH] Make XFS workqueues nonfreezable Rafael J. Wysocki
2007-03-01  8:03                           ` Andrew Morton
2007-03-01  9:15                             ` Pavel Machek
2007-03-01  9:25                               ` Andrew Morton
2007-02-28 21:16                   ` Problem with freezable workqueues Pavel Machek
2007-03-06  0:30 ` Johannes Berg
2007-03-06 20:31   ` Rafael J. Wysocki
2007-03-06 22:25     ` Nigel Cunningham
2007-03-06 22:57       ` Rafael J. Wysocki
2007-03-07 23:10     ` Johannes Berg

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=20070228131721.GD15509@in.ibm.com \
    --to=vatsa@in.ibm.com \
    --cc=ego@in.ibm.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@tv-sign.ru \
    --cc=pavel@ucw.cz \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.