Re: [PATCH v7 18/23] locking/lockdep: Add support for dynamic keys

From: Peter Zijlstra
Date: Tue Feb 26 2019 - 12:18:15 EST


On Thu, Feb 14, 2019 at 03:00:53PM -0800, Bart Van Assche wrote:
> +/* hash_entry is used to keep track of dynamically allocated keys. */
> struct lock_class_key {
> + struct hlist_node hash_entry;
> struct lockdep_subclass_key subkeys[MAX_LOCKDEP_SUBCLASSES];
> };

I think we can make that:

struct lock_class_key {
union {
struct hlist_node hash_entry;
struct lockdep_subclass_key subkeys[MAX_LOCKDEP_SUBCLASSES];
};
};

I've added a patch to that effect at the end. IIRC we never actually
store anything in the subkeys, we just use the address.