Re: Latches vs lwlock contention

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: vignesh C <vignesh21@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>, Yura Sokolov <y.sokolov@postgrespro.ru>, Andres Freund <andres@anarazel.de>
Date: 2023-03-04T19:50:30Z
Lists: pgsql-hackers

Attachments

On Sat, Jan 28, 2023 at 3:39 AM vignesh C <vignesh21@gmail.com> wrote:
> On Tue, 1 Nov 2022 at 16:40, Thomas Munro <thomas.munro@gmail.com> wrote:
> > Here's an attempt at that.  There aren't actually any cases of uses of
> > this stuff in critical sections here, so perhaps I shouldn't bother
> > with that part.  The part I'd most like some feedback on is the
> > heavyweight lock bits.  I'll add this to the commitfest.
>
> The patch does not apply on top of HEAD as in [1], please post a rebased patch:

Rebased.  I dropped the CV patch for now.

Commits

  1. Fix crash if LockErrorCleanup() is called twice

  2. Split ProcSleep function into JoinWaitQueue and ProcSleep

  3. Move TRACE calls into WaitOnLock()

  4. Set MyProc->heldLocks in ProcSleep

  5. Fix comment in LockReleaseAll() on when locallock->nLock can be zero

  6. Allow a no-wait lock acquisition to succeed in more cases.

  7. Teach planner about more monotonic window functions