diff options
| author | Thomas Munro | 2021-02-28 23:06:09 +0000 |
|---|---|---|
| committer | Thomas Munro | 2021-03-01 01:12:02 +0000 |
| commit | 6a2a70a02018d6362f9841cc2f499cc45405e86b (patch) | |
| tree | 28a7760914dd066dbd2310cc29e893ac7c6b13a0 /src/backend/libpq | |
| parent | 83709a0d5a46559db016c50ded1a95fd3b0d3be6 (diff) | |
Use signalfd(2) for epoll latches.
Cut down on system calls and other overheads by reading from a signalfd
instead of using a signal handler and self-pipe. Affects Linux sytems,
and possibly others including illumos that implement the Linux epoll and
signalfd interfaces.
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CA+hUKGJjxPDpzBE0a3hyUywBvaZuC89yx3jK9RFZgfv_KHU7gg@mail.gmail.com
Diffstat (limited to 'src/backend/libpq')
| -rw-r--r-- | src/backend/libpq/pqsignal.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/libpq/pqsignal.c b/src/backend/libpq/pqsignal.c index b43af220303..dedf3a456d8 100644 --- a/src/backend/libpq/pqsignal.c +++ b/src/backend/libpq/pqsignal.c @@ -35,13 +35,15 @@ sigset_t UnBlockSig, * collection; it's essentially BlockSig minus SIGTERM, SIGQUIT, SIGALRM. * * UnBlockSig is the set of signals to block when we don't want to block - * signals (is this ever nonzero??) + * signals. */ void pqinitmask(void) { sigemptyset(&UnBlockSig); + /* Note: InitializeLatchSupport() modifies UnBlockSig. */ + /* First set all signals, then clear some. */ sigfillset(&BlockSig); sigfillset(&StartupBlockSig); |
