From: Rusty Russell <rusty@rustcorp.com.au>
To: Srivatsa Vaddagiri <vatsa@in.ibm.com>
Cc: Andrew Morton <akpm@osdl.org>, Ingo Molnar <mingo@elte.hu>,
lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Fix deadlock in __create_workqueue
Date: Wed, 05 May 2004 18:37:04 +1000 [thread overview]
Message-ID: <1083746224.14112.7.camel@bach> (raw)
In-Reply-To: <20040503122316.GA7143@in.ibm.com>
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
prev parent reply other threads:[~2004-05-05 8:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-30 11:37 [PATCH] Fix deadlock in __create_workqueue Srivatsa Vaddagiri
2004-05-01 2:19 ` Andrew Morton
2004-05-03 12:24 ` Srivatsa Vaddagiri
2004-05-03 20:08 ` Andrew Morton
2004-05-04 6:51 ` Srivatsa Vaddagiri
2004-05-01 2:27 ` Andrew Morton
2004-05-03 12:23 ` Srivatsa Vaddagiri
2004-05-03 19:25 ` Andrew Morton
2004-05-04 6:50 ` Srivatsa Vaddagiri
2004-05-04 7:35 ` Andrew Morton
2004-05-05 8:37 ` Rusty Russell [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1083746224.14112.7.camel@bach \
--to=rusty@rustcorp.com.au \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=vatsa@in.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox