Messages in this thread | | | Subject | Re: [PATCH] Fix deadlock in __create_workqueue | From | Rusty Russell <> | Date | Wed, 05 May 2004 18:37:04 +1000 |
| |
On Mon, 2004-05-03 at 22:23, Srivatsa Vaddagiri wrote: > On Fri, Apr 30, 2004 at 07:27:12PM -0700, Andrew Morton wrote: > > Can we not simply do: > > > > > > diff -puN kernel/workqueue.c~a kernel/workqueue.c > > --- 25/kernel/workqueue.c~a 2004-04-30 19:26:32.003303600 -0700 > > +++ 25-akpm/kernel/workqueue.c 2004-04-30 19:26:44.492404968 -0700 > > @@ -334,6 +334,7 @@ struct workqueue_struct *__create_workqu > > destroy = 1; > > } > > } > > + unlock_cpu_hotplug(); > > > > /* > > * Was there any error during startup? If yes then clean up: > > @@ -342,7 +343,6 @@ struct workqueue_struct *__create_workqu > > destroy_workqueue(wq); > > wq = NULL; > > } > > - unlock_cpu_hotplug(); > > return wq; > > } > > I didn't do this because I introduced a break at the first instance > when create_workqueue_thread failed. Breaking out of the loop > like that appeared to be more efficient rather than going back and > trying to create threads for rest of the online cpus, because most > likely thread creation will fail for other cpus also and anyway > the workqueue will be destroyed down the line.
The logic was not the way I would have done it, but it *is* neater. I prefer the akpm fix I think.
Rusty. -- Anyone who quotes me in their signature is an idiot -- Rusty Russell
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |