Re: [Patch] workqueue: move lockdep annotations up todestroy_workqueue()

From: Oleg Nesterov
Date: Wed Mar 31 2010 - 07:28:19 EST


On 03/31, Amerigo Wang wrote:
>
> This fixes a lockdep warning when invoking destroy_workqueue(),
> because the lockdep annotations are invoked under cpu_add_remove_lock.

Confused. Why does lockdep complains?

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

OK, but nobody should take cpu_maps_update_begin() under wq->lockdep_map,
in particular work->func() must not.

I must have missed something, but it seems to me this patch tries to
supress the valid warning.

Could you please clarify?

Oleg.

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