Re: Latches vs lwlock contention

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Yura Sokolov <y(dot)sokolov(at)postgrespro(dot)ru>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Latches vs lwlock contention
Date: 2022-11-01 11:09:25
Message-ID: CA+hUKG+UfnpJwxUJO-XoAJ-JabXAhmkTwwjG8HLfi7XiQz_bxA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 28, 2022 at 4:56 PM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> See attached sketch patches. I guess the main thing that may not be
> good enough is the use of a fixed sized latch buffer. Memory
> allocation in don't-throw-here environments like the guts of lock code
> might be an issue, which is why it just gives up and flushes when
> full; maybe it should try to allocate and fall back to flushing only
> if that fails.

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.

Attachment Content-Type Size
v2-0001-Allow-palloc_extended-NO_OOM-in-critical-sections.patch application/octet-stream 1.9 KB
v2-0002-Provide-SetLatches-for-batched-deferred-latches.patch application/octet-stream 9.3 KB
v2-0003-Use-SetLatches-for-condition-variables.patch application/octet-stream 7.9 KB
v2-0004-Use-SetLatches-for-heavyweight-locks.patch application/octet-stream 13.8 KB
v2-0005-Don-t-re-acquire-LockManager-partition-lock-after.patch application/octet-stream 6.3 KB
v2-0006-Use-SetLatches-for-SERIALIZABLE-DEFERRABLE-wakeup.patch application/octet-stream 4.7 KB
v2-0007-Use-SetLatches-for-synchronous-replication-wakeup.patch application/octet-stream 3.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2022-11-01 11:19:54 Re: [PATCH] Improve tab completion for ALTER TABLE on identity columns
Previous Message Andy Fan 2022-11-01 11:08:52 Re: Prefetch the next tuple's memory during seqscans