lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 22 Aug 2020 10:52:44 +0800
From:   boqun.feng@...il.com
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
        Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
        Jonathan Corbet <corbet@....net>,
        Waiman Long <longman@...hat.com>
Subject: Re: [RFC v7 14/19] lockdep: Take read/write status in consideration
 when generate chainkey

On Fri, Aug 21, 2020 at 07:41:32PM +0200, Peter Zijlstra wrote:
> 
> So far so good, excellent work.
> 
> On Fri, Aug 07, 2020 at 03:42:33PM +0800, Boqun Feng wrote:
> > @@ -371,6 +371,21 @@ static struct hlist_head classhash_table[CLASSHASH_SIZE];
> >  
> >  static struct hlist_head chainhash_table[CHAINHASH_SIZE];
> >  
> > +/*
> > + * the id of held_lock
> > + */
> > +static inline u16 hlock_id(struct held_lock *hlock)
> > +{
> > +	BUILD_BUG_ON(MAX_LOCKDEP_KEYS_BITS + 2 > 16);
> > +
> > +	return (hlock->class_idx | (hlock->read << MAX_LOCKDEP_KEYS_BITS));
> > +}
> > +
> > +static inline unsigned int chain_hlock_class_idx(u16 hlock_id)
> > +{
> > +	return hlock_id & MAX_LOCKDEP_KEYS;
> 
> But did that want to be:
> 
> 	return hlock_id & (MAX_LOCKDEP_KEYS-1);
> 

Right, clearly I'm missing the fact we have change the definition of 
MAX_LOCKDEP_KEYS at commit 01bb6f0af992 ("locking/lockdep: Change the
range of class_idx in held_lock struct").

Thanks for catching this!

Regards,
Boqun

> ?
> 
> > +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ