lkml.org 
[lkml]   [2014]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: check && lockdep_no_validate (Was: lockdep: Introduce wait-type checks)
On 01/12, Peter Zijlstra wrote:
>
> On Thu, Jan 09, 2014 at 06:54:48PM +0100, Oleg Nesterov wrote:
> >
> > --- a/kernel/locking/lockdep.c
> > +++ b/kernel/locking/lockdep.c
> > @@ -1939,7 +1939,8 @@ check_prevs_add(struct task_struct *curr, struct held_lock *next)
> > * Only non-recursive-read entries get new dependencies
> > * added:
> > */
> > - if (hlock->read != 2) {
> > + if (hlock->read != 2 &&
> > + hlock->instance->key != &__lockdep_no_validate__) {
> > if (!check_prev_add(curr, hlock, next,
> > distance, trylock_loop))
> > return 0;
> >
>
> Hmm, you are quite right indeed;

Thanks!

> although I would write it like:
>
> if (hlock->read != 2 && hlock->check == 2)
>
> because the __lockdep_no_validate__ thing forces the ->check value to 1.

Agreed, hlock->check == 2 looks better. But this connects to another
patch I sent which removes hlock->check...

OK, I'll wait for review on that patch, then resend this one with
->check or __lockdep_no_validate__ depending on the result.

Oleg.



\
 
 \ /
  Last update: 2014-01-13 19:41    [W:0.283 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site