Re: [PATCH v5 07/15] locking/lockdep: Free lock classes that are no longer in use

From: Peter Zijlstra
Date: Thu Jan 10 2019 - 10:45:24 EST


On Thu, Jan 10, 2019 at 04:20:35PM +0100, Peter Zijlstra wrote:
> On Mon, Dec 17, 2018 at 01:29:54PM -0800, Bart Van Assche wrote:

> > + /*
> > + * Leak *chain because it is not safe to reinsert it before an RCU
> > + * grace period has expired.
> > + */
> > + new_chain = lock_chains + nr_lock_chains++;
> > + *new_chain = *chain;
> > + hlist_add_head_rcu(&new_chain->entry, chainhashentry(chain_key));
> > +#endif
> > +}
>
> Leaking a chain_hlocks[] and lock_chains[] entry is pretty gross, but
> yes that should work.

/me finds patch 10 and goes.. ooh shiny ;-)