Re: Interrupts vs signals
Heikki Linnakangas <hlinnaka@iki.fi>
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Andres Freund <andres@anarazel.de>
Cc: Thomas Munro <thomas.munro@gmail.com>,
Michael Paquier <michael@paquier.xyz>, Robert Haas <robertmhaas@gmail.com>,
Fujii Masao <masao.fujii@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-02-28T20:24:56Z
Lists: pgsql-hackers
Attachments
- 0001-Remove-unused-ShutdownLatchSupport-function.patch (text/x-patch) patch 0001
- 0002-Use-ModifyWaitEvent-to-update-exit_on_postmaster_dea.patch (text/x-patch) patch 0002
- 0003-Split-WaitEventSet-functions-to-separate-source-file.patch (text/x-patch) patch 0003
On 28/01/2025 19:01, Andres Freund wrote: > On 2024-12-02 16:39:28 +0200, Heikki Linnakangas wrote: >> This also moves the WaitEventSet functions to a different source file, >> waiteventset.c. This separates the platform-dependent code waiting and >> signalling code from the platform-independent parts. > > I think this should be split into a separate commit. It's painful to verify > that code-movement didn't change anything else if there's lots of other > changes in the same commit. Here's a patch set to do just that, split WaitEventSet stuff to a separate source file. That's actually a pretty nice separation even without any of the rest of the patches. I noticed that the ShutdownLatchSupport() function is unused. The first patch removes it. The second patch makes it possible to use ModifyWaitEvent() to switch between WL_POSTMASTER_DEATH and WL_EXIT_ON_PM_DEATH. WaitLatch() used to modify WaitEventSet->exit_on_postmaster_death directly, now it uses ModifyWaitEvent() for that. That's needed because with the final patch, WaitLatch() is in a different source file than WaitEventSet, so it cannot directly modify its field anymore. The third patch is mechanical and moves existing code. The file header comments in the modified files are perhaps worth reviewing. They are also just existing text moved around, but there was some small decisions on what exactly should go where. I'll continue working on the other parts, but these patches seems ready for commit already. -- Heikki Linnakangas Neon (https://neon.tech)
Commits
-
Ignore SIGINT in walwriter and walsummarizer
- a92b809f9da1 19 (unreleased) landed
-
Split WaitEventSet functions to separate source file
- 393e0d231405 18.0 landed
-
Use ModifyWaitEvent to update exit_on_postmaster_death
- 84e5b2f07a5e 18.0 landed
-
Remove unused ShutdownLatchSupport() function
- a98e4dee63ce 18.0 landed
-
Rename two functions that wake up other processes
- 368d8270c838 18.0 landed
-
Use ProcNumbers instead of direct Latch pointers to address other procs
- a9c546a5a378 18.0 landed
-
Clean up WaitLatch calls that passed latch without WL_LATCH_SET
- f9ecb57a506a 18.0 landed
-
Remove unneeded #include
- 094ae071605d 18.0 landed
-
Remove unused latch
- 6c0c49f7d37d 18.0 landed
-
Remove support for background workers without BGWORKER_SHMEM_ACCESS.
- 80a8f95b3bca 15.0 cited