The patch titled workqueues: add comments to __create_workqueue_key() has been removed from the -mm tree. Its filename was workqueues-add-comments-to-__create_workqueue_key.patch This patch was dropped because it was merged into mainline or a subsystem tree The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: workqueues: add comments to __create_workqueue_key() From: Oleg Nesterov <oleg@xxxxxxxxxx> Dmitry Adamushko pointed out that the error handling in __create_workqueue_key() is not clear, add the comment. Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx> Cc: Dmitry Adamushko <dmitry.adamushko@xxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/workqueue.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff -puN kernel/workqueue.c~workqueues-add-comments-to-__create_workqueue_key kernel/workqueue.c --- a/kernel/workqueue.c~workqueues-add-comments-to-__create_workqueue_key +++ a/kernel/workqueue.c @@ -830,10 +830,21 @@ struct workqueue_struct *__create_workqu start_workqueue_thread(cwq, -1); } else { cpu_maps_update_begin(); + /* + * We must place this wq on list even if the code below fails. + * cpu_down(cpu) can remove cpu from cpu_populated_map before + * destroy_workqueue() takes the lock, in that case we leak + * cwq[cpu]->thread. + */ spin_lock(&workqueue_lock); list_add(&wq->list, &workqueues); spin_unlock(&workqueue_lock); - + /* + * We must initialize cwqs for each possible cpu even if we + * are going to call destroy_workqueue() finally. Otherwise + * cpu_up() can hit the uninitialized cwq once we drop the + * lock. + */ for_each_possible_cpu(cpu) { cwq = init_cpu_workqueue(wq, cpu); if (err || !cpu_online(cpu)) _ Patches currently in -mm which might be from oleg@xxxxxxxxxx are origin.patch linux-next.patch migrate_timers-add-comment-use-spinlock_irq.patch sched-do_wait_for_common-use-signal_pending_state.patch wait_task_inactive-dont-consider-task-nivcsw.patch semaphore-__down_common-use-signal_pending_state.patch posix-timers-fix-posix_timer_event-vs-dequeue_signal-race.patch posix-timers-do_schedule_next_timer-fix-the-setting-of-si_overrun.patch coredump-format_corename-dont-append-%pid-if-multi-threaded.patch kthread_bind-use-wait_task_inactivetask_uninterruptible.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html