Use a long lived WaitEventSet for WaitLatch().
Thomas Munro <tmunro@postgresql.org>
Use a long lived WaitEventSet for WaitLatch(). Create LatchWaitSet at backend startup time, and use it to implement WaitLatch(). This avoids repeated epoll/kqueue setup and teardown system calls. Reorder SubPostmasterMain() slightly so that we restore the postmaster pipe and Windows signal emulation before we reach InitPostmasterChild(), to make this work in EXEC_BACKEND builds. Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Discussion: https://postgr.es/m/CA%2BhUKGJAC4Oqao%3DqforhNey20J8CiG2R%3DoBPqvfR0vOJrFysGw%40mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/postmaster/postmaster.c | modified | +12 −12 |
| src/backend/storage/ipc/latch.c | modified | +52 −4 |
| src/backend/utils/init/miscinit.c | modified | +2 −0 |
| src/include/storage/latch.h | modified | +1 −0 |
Discussion
- Reducing WaitEventSet syscall churn 15 messages · 2020-01-21 → 2021-03-01