From 6a2a70a02018d6362f9841cc2f499cc45405e86b Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Mon, 1 Mar 2021 12:06:09 +1300 Subject: 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 Discussion: https://postgr.es/m/CA+hUKGJjxPDpzBE0a3hyUywBvaZuC89yx3jK9RFZgfv_KHU7gg@mail.gmail.com --- src/backend/utils/init/miscinit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/backend/utils') diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c index 734c66d4e8..e6550f99ee 100644 --- a/src/backend/utils/init/miscinit.c +++ b/src/backend/utils/init/miscinit.c @@ -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 -- cgit v1.2.3