Re: make LWLockCounter a global variable

2025-08-29 Thread Nathan Bossart
On Fri, Aug 29, 2025 at 09:43:26AM -0500, Nathan Bossart wrote: > Good idea. Here's a new version of the patch. If CI is happy with it, > I'll go ahead and commit it. Committed. -- nathan

Re: make LWLockCounter a global variable

2025-08-29 Thread Nathan Bossart
On Fri, Aug 29, 2025 at 06:52:48AM +, Bertrand Drouvot wrote: > On Thu, Aug 28, 2025 at 05:56:07PM -0400, Tom Lane wrote: >> No objection here. As a small improvement, perhaps you could swap >> around the code in LWLockShmemSize so that the order in which it >> considers size contributions mat

Re: make LWLockCounter a global variable

2025-08-28 Thread Bertrand Drouvot
Hi, On Thu, Aug 28, 2025 at 05:56:07PM -0400, Tom Lane wrote: > Nathan Bossart writes: > > In lwlock.c, uses of LWLockCounter must first calculate its address in > > shared memory with something like this: > > > LWLockCounter = (int *) ((char *) MainLWLockArray - sizeof(int)); > > > This ap

Re: make LWLockCounter a global variable

2025-08-28 Thread Tom Lane
Nathan Bossart writes: > In lwlock.c, uses of LWLockCounter must first calculate its address in > shared memory with something like this: > LWLockCounter = (int *) ((char *) MainLWLockArray - sizeof(int)); > This appears to have been started by commit 82e861f in order to fix > EXEC_BACKEND