On Mon, Jan 08, 2007 at 08:06:35PM +0300, Oleg Nesterov wrote:
I think the problem is not just with CPU_DEAD. Anyone who calls
cleanup_workqueue_thread (say destroy_workqueue?) will see this race.
Do you see any problems if cleanup_workqueue_thread is changed as:
cleanup_workqueue_thread()
{
kthread_stop(p);
spin_lock(cwq->lock);
cwq->thread = NULL;
spin_unlock(cwq->lock);
}
Ok ..yes a cpu_event_waits_for_lock() helper will help here.
I dont see as of now. I suspect we will know better when we implement
the patch to eliminate CPU_DEAD handling in workqueue.c
--
Regards,
vatsa
-