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/5620~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/5620
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on May 29, 2025

  1. Improve accounting for memory used by shared hash tables

    pg_shmem_allocations tracks the memory allocated by ShmemInitStruct(),
    but for shared hash tables that covered only the header and hash
    directory.  The remaining parts (segments and buckets) were allocated
    later using ShmemAlloc(), which does not update the shmem accounting.
    Thus, these allocations were not shown in pg_shmem_allocations.
    
    This commit improves the situation by allocating all the hash table
    parts at once, using a single ShmemInitStruct() call. This way the
    ShmemIndex entries (and thus pg_shmem_allocations) better reflect the
    proper size of the hash table.u
    
    This does not change anything for non-shared hash tables.
    
    This changes the alignment a bit. ShmemAlloc() aligns the chunks using
    CACHELINEALIGN(), which means some parts (header, directory, segments)
    were aligned this way. Allocating all parts as a single chunk removes
    this (implicit) alignment. We've considered adding explicit alignment,
    but we've decided not to - it seems to be merely a coincidence due to
    using the ShmemAlloc() API, not due to necessity.
    
    Author: Rahila Syed <rahilasyed90@gmail.com>
    Reviewed-by: Andres Freund <andres@anarazel.de>
    Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com>
    Reviewed-by: Tomas Vondra <tomas@vondra.me>
    Discussion: https://postgr.es/m/CAH2L28vHzRankszhqz7deXURxKncxfirnuW68zD7+hVAqaS5GQ@mail.gmail.com
    Rahila authored and Commitfest Bot committed May 29, 2025
    Configuration menu
    Copy the full SHA
    fe46124 View commit details
    Browse the repository at this point in the history
  2. [CF 5620] v10 - Improve monitoring of shared memory allocations

    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5620
    
    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/CAH2L28vgzvTUqNwQay=jx4w30sHMx_pC+emnZErv8oX0R+SALQ@mail.gmail.com
    Author(s): Rahila Syed
    Commitfest Bot committed May 29, 2025
    Configuration menu
    Copy the full SHA
    b937dd2 View commit details
    Browse the repository at this point in the history
Loading