Re: [PATCH] Fix deadlock in __create_workqueue

From: Andrew Morton
Date: Tue May 04 2004 - 02:37:37 EST


Srivatsa Vaddagiri <vatsa@xxxxxxxxxx> wrote:
>
> On Mon, May 03, 2004 at 12:25:20PM -0700, Andrew Morton wrote:
> > Well that create_workqueue_thread() will basically never fail - it's not a
> > path we need to be optimising.
>
> Even if thread creation normally never fails, we still check for its
> return code and have some error recovery code! In that case,
> I dont understand the point behind continuing the loop once thread
> destruction fails for some CPU. Lets say on a 128 CPU machine, if
> thread creation fails for the 1st CPU (because of say ENOMEM?), then
> why continue trying to create threads for the rest of 126 CPUs and
> _then_ destroy? Why not just break at the first occurence of failure
> and cleanup then and there?
>

Because there's less code to get wrong.

In this situation, correctness, clarity and code size are the only things
we care about.
-
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/