From: Amerigo Wang on 31 Mar 2010 07:00 This fixes a lockdep warning when invoking destroy_workqueue(), because the lockdep annotations are invoked under cpu_add_remove_lock. So, move the lockdep annotations before taking cpu_add_remove_lock in destroy_workqueue(), this will not affect the original purpose of adding them for destroy_workqueue() etc. However, it will affect another caller of cleanup_workqueue_thread(), that is, workqueue_cpu_callback(). This should be fine, because there are no other cases than cpu hotplug could call it. Signed-off-by: WANG Cong <amwang(a)redhat.com> Cc: Oleg Nesterov <oleg(a)redhat.com> Cc: Tejun Heo <tj(a)kernel.org> Cc: Ingo Molnar <mingo(a)elte.hu> Cc: Rusty Russell <rusty(a)rustcorp.com.au> --- diff --git a/kernel/workqueue.c b/kernel/workqueue.c index dee4865..0f050e2 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1025,9 +1025,6 @@ static void cleanup_workqueue_thread(struct cpu_workqueue_struct *cwq) if (cwq->thread == NULL) return; - lock_map_acquire(&cwq->wq->lockdep_map); - lock_map_release(&cwq->wq->lockdep_map); - flush_cpu_workqueue(cwq); /* * If the caller is CPU_POST_DEAD and cwq->worklist was not empty, @@ -1055,6 +1052,9 @@ void destroy_workqueue(struct workqueue_struct *wq) const struct cpumask *cpu_map = wq_cpu_map(wq); int cpu; + lock_map_acquire(&wq->lockdep_map); + lock_map_release(&wq->lockdep_map); + cpu_maps_update_begin(); spin_lock(&workqueue_lock); list_del(&wq->list); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|
Pages: 1 Prev: sched: check for prev_cpu == this_cpu before calling wake_affine() Next: (none) |