lkml.org 
[lkml]   [2017]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/3] lockdep: Make LOCKDEP_CROSSRELEASE configs all part of PROVE_LOCKING
On Wed, Aug 23, 2017 at 12:46:48PM +0200, Peter Zijlstra wrote:
> On Wed, Aug 23, 2017 at 11:31:18AM +0900, Byungchul Park wrote:
> > On Tue, Aug 22, 2017 at 11:06:03AM +0200, Peter Zijlstra wrote:
>
> > Currently, we do the following in process_one_work(),
> >
> > lockdep_map_acquire for a workqueue
> > lockdep_map_acquire for a work
> >
> > But IMHO it should be,
> >
> > lockdep_map_acquire for a pair of workqueue and work.
> >
> > Right?
>
> No, it is right. We need the two 'locks'.
>
> The work one is for flush_work(), the workqueue one is for
> flush_workqueue().
>
> Just like how flush_work() must not depend on any lock taken inside the
> work, flush_workqueue() callers must not hold any lock acquired inside
> any work ran inside the workqueue. This cannot be done with a single
> 'lock'.

Thank you for explanation.

> The reason flush_work() also depends on the wq 'lock' is because doing
> flush_work() from inside work is a possible problem for single threaded
> workqueues and workqueues with a rescuer.
>
> > > Agreed. The interaction with workqueues is buggered.
> >
> > I think original uses of lockdep_map were already wrong. I mean it's
> > not a problem of newly introduced code.
>
> Not wrong per-se, the new code certainly places more constraints on it.

"the new code places more constraints on it" is just the right expression.

\
 
 \ /
  Last update: 2017-08-24 07:06    [W:0.081 / U:2.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site