[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200702281840.40113.rjw@sisk.pl>
Date: Wed, 28 Feb 2007 18:40:39 +0100
From: "Rafael J. Wysocki" <rjw@...k.pl>
To: vatsa@...ibm.com
Cc: Pavel Machek <pavel@....cz>, Gautham R Shenoy <ego@...ibm.com>,
Johannes Berg <johannes@...solutions.net>,
LKML <linux-kernel@...r.kernel.org>,
Oleg Nesterov <oleg@...sign.ru>
Subject: Re: Problem with freezable workqueues
On Wednesday, 28 February 2007 14:17, Srivatsa Vaddagiri wrote:
> 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?
Sure, I will.
> 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.
This one already is in -mm.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists