Re: Reducing WaitEventSet syscall churn

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reducing WaitEventSet syscall churn
Date: 2020-02-07 21:00:27
Message-ID: CA+hUKG+zCNJZBXcURPdQvdY-tjyD0y7Li2wZEC6XChyUej1S5w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 21, 2020 at 1:45 PM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> Here are some patches to get rid of frequent system calls.

Here is one more case that I was sitting on because I wasn't sure how
to do it: walreceiver.c. To make that work, libpq needs to be able to
tell you when the socket has changed, which I did with a counter that
is exposed to client code in patch 0004. The walreceiver change in
0005 works (trace the system calls on walreceiver to see the
difference), but perhaps we can come up with a better way to code it
so that eg logical/worker.c doesn't finish up duplicating the logic.
Thoughts?

Attachment Content-Type Size
0001-Add-WaitMyLatch-to-replace-many-WaitLatch-calls.patch application/octet-stream 13.8 KB
0002-Use-WaitMyLatch-for-condition-variables.patch application/octet-stream 2.3 KB
0003-Introduce-a-reusable-WaitEventSet-for-the-stats-coll.patch application/octet-stream 2.7 KB
0004-libpq-Add-PQsocketChangeCount-to-advertise-socket-ch.patch application/octet-stream 4.2 KB
0005-Reuse-a-WaitEventSet-in-walreceiver.patch application/octet-stream 8.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2020-02-07 21:13:39 Re: pg_basebackup and snapshots
Previous Message Andres Freund 2020-02-07 20:21:56 Re: pg_basebackup and snapshots