On Tue, May 7, 2019 at 12:16 PM Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote: > > Negative ->d_lockref.count are used for "lockref is dead"... We can change that to just -1, can't we? It's equally easy to test for. Those aren't supposed to be incremented anyway, which is the whole point. But we could do what the page refs also did: consider refcounts in the "small negative range" to be very special, because they are either critically close to an overflow, or they are actually a sign of a fatal underflow due to some bug. And make one of those be the dead marker. (See page_ref_zero_or_close_to_overflow() for the particular critical range check for the page ref) Linus