Re: Refactor GetLockStatusData() by skipping unused backends and groups

2024-10-25 Thread Fujii Masao
On 2024/10/24 11:12, Bertrand Drouvot wrote: So, probably we can consider that this check is already in place. If it’s still worth adding, perhaps placing it inside the FAST_PATH_SLOT() macro could be an option... Or current assertion check is enough? Thought? Given that it's already done in

Re: Refactor GetLockStatusData() by skipping unused backends and groups

2024-10-23 Thread Bertrand Drouvot
Hi, On Wed, Oct 23, 2024 at 01:19:37AM +0900, Fujii Masao wrote: > > I understand that PGPROC entries with pid=0 are typically those not yet > allocated to > any backends. Yes, as you mentioned, prepared transactions also have pid=0. > However, > GetLockStatusData() loops up to ProcGlobal->allP

Re: Refactor GetLockStatusData() by skipping unused backends and groups

2024-10-22 Thread Fujii Masao
On 2024/10/21 16:32, Bertrand Drouvot wrote: A few random comments on it: Thanks for the review! 1 === + /* Skip backends with pid=0, as they don't hold fast-path locks */ + if (proc->pid == 0) + continue; What about adding a few words i

Re: Refactor GetLockStatusData() by skipping unused backends and groups

2024-10-21 Thread Bertrand Drouvot
Hi, On Mon, Oct 21, 2024 at 09:19:49AM +0900, Fujii Masao wrote: > Hi, > > While reading the fast-path lock code, I noticed that GetLockStatusData() > checks all slots for every backend to gather fast-path lock data. However, > backends with PID=0 don't hold fast-path locks, right? I think the s

Refactor GetLockStatusData() by skipping unused backends and groups

2024-10-20 Thread Fujii Masao
Hi, While reading the fast-path lock code, I noticed that GetLockStatusData() checks all slots for every backend to gather fast-path lock data. However, backends with PID=0 don't hold fast-path locks, right? If so, we can improve efficiency by having GetLockStatusData() skip those backends early.