Re: [RFC v7 14/19] lockdep: Take read/write status in consideration when generate chainkey

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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);

?

> +}



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux