On Mon, 30 Oct 2023 08:56:50 -0400 Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx> wrote: > > This only works if "your" lock implementation is the only user of this > RSEQ feature within a process. RSEQ requires that multiple libraries can > share the facilities. Therefore, the rseq field should include the > nesting counter as part of the RSEQ ABI so various userspace libraries > can use it collaboratively. > Then I would suggest allowing bit 31 be an "on/off" switch, and the lower bits to be a counter. When I first tried this with postgres, there was one lwlock that looked to be held for the majority of the run, so I got rid of the nesting. But I think a mixture of both would work, where you can have a nesting counter and an on/off switch with the caveat that if you use it and enable it, another library may disable it. -- Steve