lkml.org 
[lkml]   [2018]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] workqueue: create lockdep dependency in flush_work()
On Tue, Aug 21, 2018 at 02:03:17PM +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> In flush_work(), we need to create a lockdep dependency so that
> the following scenario is appropriately tagged as a problem:
>
> work_function()
> {
> mutex_lock(&mutex);
> ...
> }
>
> other_function()
> {
> mutex_lock(&mutex);
> flush_work(&work); // or cancel_work_sync(&work);
> }
>
> This is a problem since the work might be running and be blocked
> on trying to acquire the mutex.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>

This makes sense to me. Did you notice any extra lockdep warnings
with this?

Thanks.

--
tejun

\
 
 \ /
  Last update: 2018-08-21 18:10    [W:0.124 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site