Re: [PATCH, RFC] reimplement flush_workqueue()

From: Andrew Morton
Date: Thu Jan 04 2007 - 13:32:22 EST


On Thu, 4 Jan 2007 21:09:01 +0300
Oleg Nesterov <oleg@xxxxxxxxxx> wrote:

> > --- a/kernel/workqueue.c~flush_workqueue-use-preempt_disable-to-hold-off-cpu-hotplug
> > +++ a/kernel/workqueue.c
> > @@ -419,18 +419,22 @@ static void flush_cpu_workqueue(struct c
> > * Probably keventd trying to flush its own queue. So simply run
> > * it by hand rather than deadlocking.
> > */
> > - mutex_unlock(&workqueue_mutex);
> > + preempt_enable();
>
> Ah, (looking at _cpu_down()->stop_machine()), so preempt_disable() not only "pins"
> the current CPU, it blocks cpu_down(), yes ???

yep.

But before we do much more of this we should have a wrapper. Umm

static inline void block_cpu_hotplug(void)
{
preempt_disable();
}

and use that, so people can see why it's being used.

I spose I'll do that and convert this patch to use it.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/