pgsql: lwlock: Fix quadratic behavior with very long wait lists

2024-01-17 Thread Michael Paquier
lwlock: Fix quadratic behavior with very long wait lists Until now LWLockDequeueSelf() sequentially searched the list of waiters to see if the current proc is still is on the list of waiters, or has already been removed. In extreme workloads, where the wait lists are very long, this leads to a

pgsql: lwlock: Fix quadratic behavior with very long wait lists

2024-01-17 Thread Michael Paquier
lwlock: Fix quadratic behavior with very long wait lists Until now LWLockDequeueSelf() sequentially searched the list of waiters to see if the current proc is still is on the list of waiters, or has already been removed. In extreme workloads, where the wait lists are very long, this leads to a

pgsql: lwlock: Fix quadratic behavior with very long wait lists

2024-01-17 Thread Michael Paquier
lwlock: Fix quadratic behavior with very long wait lists Until now LWLockDequeueSelf() sequentially searched the list of waiters to see if the current proc is still is on the list of waiters, or has already been removed. In extreme workloads, where the wait lists are very long, this leads to a

pgsql: lwlock: Fix quadratic behavior with very long wait lists

2024-01-17 Thread Michael Paquier
lwlock: Fix quadratic behavior with very long wait lists Until now LWLockDequeueSelf() sequentially searched the list of waiters to see if the current proc is still is on the list of waiters, or has already been removed. In extreme workloads, where the wait lists are very long, this leads to a

pgsql: lwlock: Fix quadratic behavior with very long wait lists

2022-11-20 Thread Andres Freund
lwlock: Fix quadratic behavior with very long wait lists Until now LWLockDequeueSelf() sequentially searched the list of waiters to see if the current proc is still is on the list of waiters, or has already been removed. In extreme workloads, where the wait lists are very long, this leads to a