Re: [PATCH 1/2] workqueue: Catch more locking problems withflush_work()

From: Tejun Heo
Date: Thu Apr 19 2012 - 11:28:44 EST


On Wed, Apr 18, 2012 at 08:25:57PM -0700, Stephen Boyd wrote:
> @@ -2513,8 +2513,11 @@ bool flush_work(struct work_struct *work)
> wait_for_completion(&barr.done);
> destroy_work_on_stack(&barr.work);
> return true;
> - } else
> + } else {
> + lock_map_acquire(&work->lockdep_map);
> + lock_map_release(&work->lockdep_map);
> return false;

We don't have this annotation when start_flush_work() succeeds either,
right? IOW, would lockdep trigger when an actual deadlock happens?
If not, why not add the acquire/release() before flush_work() does
anything?

Thanks.

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