lkml.org 
[lkml]   [2004]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] Fix deadlock in __create_workqueue
Srivatsa Vaddagiri <vatsa@in.ibm.com> wrote:
>
> Noticed a possible deadlock in __create_workqueue when CONFIG_HOTPLUG_CPU is
> set. This can happen when create_workqueue_thread fails to create a worker
> thread. In that case, we call destroy_workqueue with cpu hotplug lock held.
> destroy_workqueue however also attempts to take the same lock.

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;
}

_

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

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:1.045 / U:1.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site