Re: + workqueue-proper-error-unwinding-in-cpu-hotplug-error-path.patch added to -mm tree

From: Oleg Nesterov
Date: Tue Jul 22 2008 - 04:42:01 EST


On 07/22, Andrew Morton wrote:
>
> From: Akinobu Mita <akinobu.mita@xxxxxxxxx>
>
> Add proper error unwinding in error path in CPU_UP_PREPARE notifier.

Could you clarify?

> --- a/kernel/workqueue.c~workqueue-proper-error-unwinding-in-cpu-hotplug-error-path
> +++ a/kernel/workqueue.c
> @@ -928,6 +928,15 @@ static int __devinit workqueue_cpu_callb
> break;
> printk(KERN_ERR "workqueue [%s] for %i failed\n",
> wq->name, cpu);
> +
> + list_for_each_entry_continue_reverse(wq, &workqueues,
> + list) {
> + cwq = per_cpu_ptr(wq->cpu_wq, cpu);
> + start_workqueue_thread(cwq, -1);
> + cleanup_workqueue_thread(cwq);
> + }
> + cpu_clear(cpu, cpu_populated_map);
> +
> return NOTIFY_BAD;

If CPU_UP_PREPARE fails, _cpu_up() sends CPU_UP_CANCELED, and afaics
workqueue_cpu_callback() correctly cleanups cwq->thread's.

Oleg.

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