On Tue, Oct 22, 2024 at 09:19:05AM +0200, Peter Zijlstra wrote: > > Not sure modelling it as a trylock is the right approach here, > > I've added the lockdep maintainers if they have an idea. > > So lockdep supports recursive reader state, but you're looking at > recursive exclusive state? Yes. > If you achieve this using an external nest count, then it is probably (I > haven't yet had morning juice) sufficient to use the regular exclusive > state on the outermost lock / unlock pair and simply ignore the inner > locks. There obviosuly is an external nest count here, so I guess that should do the job. Ming?