Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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/5784~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/5784
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on May 30, 2025

  1. Optimize shared LWLock acquisition for high-core-count systems

    This patch introduces optimizations to reduce lock acquisition overhead in
    LWLock by merging the read and update operations for the LW_SHARED lock's
    state. This eliminates the need for separate atomic instructions, which is
    critical for improving performance on high-core-count systems.
    
    Key changes:
    - Extended LW_SHARED_MASK by 1 bit and shifted LW_VAL_EXCLUSIVE by 1 bit to
      ensure compatibility with the upper bound of MAX_BACKENDS * 2.
    - Added a `willwait` parameter to `LWLockAttemptLock` to disable the
      optimization when the caller is unwilling to wait, avoiding conflicts
      between the reference count and the LW_VAL_EXCLUSIVE flag.
    - Updated `LWLockReleaseInternal` to use `pg_atomic_fetch_and_u32` for
      clearing lock state flags atomically.
    - Adjusted related functions (`LWLockAcquire`, `LWLockConditionalAcquire`,
      `LWLockAcquireOrWait`) to pass the `willwait` parameter appropriately.
    
    These changes improve scalability and reduce contention in workloads with
    frequent LWLock operations on servers with many cores.
    ZhiguoZh authored and Commitfest Bot committed May 30, 2025
    Configuration menu
    Copy the full SHA
    d9d940e View commit details
    Browse the repository at this point in the history
  2. [CF 5784] Optimize shared LWLock acquisition for high-core-count systems

    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5784
    
    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/73d53acf-4f66-41df-b438-5c2e6115d4de@intel.com
    Author(s): Zhiguo Zhou
    Commitfest Bot committed May 30, 2025
    Configuration menu
    Copy the full SHA
    d73c359 View commit details
    Browse the repository at this point in the history
Loading