Use signalfd(2) for epoll latches.

Thomas Munro <tmunro@postgresql.org>

Commit: 6a2a70a02018d6362f9841cc2f499cc45405e86b
Author: Thomas Munro <tmunro@postgresql.org>
Date: 2021-03-01T01:12:02Z
Releases: 14.0
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

Files

PathChange+/−
src/backend/libpq/pqsignal.c modified +3 −1
src/backend/storage/ipc/latch.c modified +110 −49
src/backend/utils/init/miscinit.c modified +5 −5

Discussion