Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cf/5931~1
Choose a base ref
...
head repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cf/5931
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Aug 9, 2025

  1. Optimize ProcSignal to avoid redundant SIGUSR1 signals

    Previously, ProcSignal used an array of volatile sig_atomic_t flags, one
    per signal reason. A sender would set a flag and then unconditionally
    send a SIGUSR1 to the target process. This could result in a storm of
    redundant signals if multiple processes signaled the same target before
    it had a chance to run its signal handler.
    
    Change this to use a single pg_atomic_uint32 as a bitmask of pending
    signals. When sending, use pg_atomic_fetch_or_u32 to set the appropriate
    signal bit and inspect the prior state of the flags word. Then only
    issue a SIGUSR1 if the previous flags state was zero. This works safely
    because the receiving backend's signal handler atomically resets the
    entire bitmask upon receipt, thus processing all pending signals at
    once. Consequently, subsequent senders seeing a nonzero prior state know
    a signal is already in flight, significantly reducing redundant
    kill(pid, SIGUSR1) system calls under heavy contention.
    
    On the receiving end, the SIGUSR1 handler now atomically fetches and
    clears the entire bitmask with a single pg_atomic_exchange_u32, then
    calls the appropriate sub-handlers.
    
    The further optimization to only check if the old flags word was zero is
    due to Andreas Karlsson.
    joelonsql authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    24ffa68 View commit details
    Browse the repository at this point in the history
  2. [CF 5931] Optimize ProcSignal to avoid redundant SIGUSR1 signals

    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5931
    
    The branch will be overwritten each time a new patch version is posted to
    the thread, and also periodically to check for bitrot caused by changes
    on the master branch.
    
    Patch(es): https://www.postgresql.org/message-id/[email protected]
    Author(s): Joel Jacobson
    Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    78a1560 View commit details
    Browse the repository at this point in the history
Loading