1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

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
This commit is contained in:
Thomas Munro
2021-03-01 12:06:09 +13:00
parent 83709a0d5a
commit 6a2a70a020
3 changed files with 118 additions and 55 deletions

View File

@ -118,6 +118,11 @@ InitPostmasterChild(void)
/* We don't want the postmaster's proc_exit() handlers */
on_exit_reset();
/* In EXEC_BACKEND case we will not have inherited BlockSig etc values */
#ifdef EXEC_BACKEND
pqinitmask();
#endif
/* Initialize process-local latch support */
InitializeLatchSupport();
MyLatch = &LocalLatchData;
@ -135,11 +140,6 @@ InitPostmasterChild(void)
elog(FATAL, "setsid() failed: %m");
#endif
/* In EXEC_BACKEND case we will not have inherited BlockSig etc values */
#ifdef EXEC_BACKEND
pqinitmask();
#endif
/*
* Every postmaster child process is expected to respond promptly to
* SIGQUIT at all times. Therefore we centrally remove SIGQUIT from