Thanks to visit codestin.com
Credit goes to github.com

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: postgres/postgres
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: anarazel/postgres
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: aio-2
Choose a head ref
  • 12 commits
  • 44 files changed
  • 2 contributors

Commits on Apr 1, 2025

  1. aio: Add errcontext for processing I/Os for another backend

    Push an ErrorContextCallback adding additional detail about the process
    performing the I/O and the owner of the I/O when those are not the same.
    
    For io_method worker, this adds context specifying which process owns
    the I/O that the I/O worker is processing.
    
    For io_method io_uring, this adds context only when a backend is
    *completing* I/O for another backend. It specifies the pid of the owning
    process.
    
    Author: Melanie Plageman <[email protected]>
    Discussion: https://postgr.es/m/20250325141120.8e.nmisch%40google.com
    melanieplageman authored and anarazel committed Apr 1, 2025
    Configuration menu
    Copy the full SHA
    bddd73d View commit details
    Browse the repository at this point in the history
  2. aio: Experimental heuristics to increase batching in read_stream.c

    Author:
    Reviewed-by:
    Discussion: https://postgr.es/m/
    Backpatch:
    anarazel committed Apr 1, 2025
    Configuration menu
    Copy the full SHA
    a97261d View commit details
    Browse the repository at this point in the history
  3. aio: Implement smgr/md/fd write support

    TODO:
    - Right now the sync.c integration with smgr.c/md.c isn't properly safe to use
      in a critical section
    
      The only reason it doesn't immediately fail is that it's reasonably rare
      that RegisterSyncRequest() fails *and* either:
    
      - smgropen()->hash_search(HASH_ENTER) decides to resize the hash table, even
        though the lookup is guaranteed to succeed for io_method=worker.
    
      - an io_method=uring completion is run in a different backend and smgropen()
        needs to build a new entry and thus needs to allocate memory
    
      For a bit I thought this could be worked around easily enough by not doing
      an smgropen() in mdsyncfiletag(), or adding a "fallible" smgropen() and
      instead just opening the file directly. That actually does kinda solve the
      problem, but only because the memory allocation in PathNameOpenFile()
      uses malloc(), not palloc() and thus doesn't trigger
    
    - temp_file_limit implementation
    anarazel committed Apr 1, 2025
    Configuration menu
    Copy the full SHA
    aed463d View commit details
    Browse the repository at this point in the history
  4. aio: Add bounce buffers

    anarazel committed Apr 1, 2025
    Configuration menu
    Copy the full SHA
    aab6be7 View commit details
    Browse the repository at this point in the history
  5. bufmgr: Implement AIO write support

    As of this commit there are no users of these AIO facilities, that'll come in
    later commits.
    
    Problems with AIO writes:
    
    - Write logic needs to be rebased on-top of the patch series to not hit bit
      dirty buffers while IO is going on
    
      The performance impact of doing the memory copies is rather substantial, as
      on intel memory bandwidth is *the* IO bottleneck even just for the checksum
      computation, without a copy. That makes the memory copy for something like
      bounce buffers hurt really badly.
    
      And the memory usage of bounce buffers is also really concerning.
    
      And even without checksums, several filesystems *really* don't like buffers
      getting modified during DIO writes. Which I think would mean we ought to use
      bounce buffers for *all* writes, which would impose a *very* substantial
      overhead (basically removing the benefit of DMA happening off-cpu).
    
    - I think it requires new lwlock.c infrastructure (as v1 of aio had), to make
      LockBuffer(BUFFER_LOCK_EXCLUSIVE) etc wait in a concurrency safe manner for
      in-progress writes
    
      I can think of ways to solve this purely in bufmgr.c, but only in ways that
      would cause other problems (e.g. setting BM_IO_IN_PROGRESS before waiting
      for an exclusive lock) and/or expensive.
    anarazel committed Apr 1, 2025
    Configuration menu
    Copy the full SHA
    39400ae View commit details
    Browse the repository at this point in the history
  6. aio: Add IO queue helper

    This is likely never going to anywhere - Thomas Munro is working on something
    more complete. But I needed a way to exercise aio for checkpointer / bgwriter.
    anarazel committed Apr 1, 2025
    Configuration menu
    Copy the full SHA
    66d2e25 View commit details
    Browse the repository at this point in the history
  7. bufmgr: use AIO in checkpointer, bgwriter

    This is far from ready - just included to be able to exercise AIO writes and
    get some preliminary numbers.  In all likelihood this will instead be based
    on-top of work by Thomas Munro instead of the preceding commit.
    
    TODO;
    
    - This doesn't implement bgwriter_flush_after, checkpointer_flush_after
    
      I think that's not too hard to do, it's mainly round tuits.
    
    - The queuing logic doesn't carefully respect pin limits
    
      That might be ok for checkpointer and bgwriter, but the infrastructure
      should be usable outside of this as well.
    anarazel committed Apr 1, 2025
    Configuration menu
    Copy the full SHA
    5097acd View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1ad522c View commit details
    Browse the repository at this point in the history
  9. Temporary: Increase BAS_BULKREAD size

    Without this we only can execute very little AIO for sequential scans, as
    there's just not enough buffers in the ring.  This isn't the right fix, as
    just increasing the ring size can have negative performance implications in
    workloads where the kernel has all the data cached.
    
    Author:
    Reviewed-By:
    Discussion: https://postgr.es/m/
    Backpatch:
    anarazel committed Apr 1, 2025
    Configuration menu
    Copy the full SHA
    2ed454d View commit details
    Browse the repository at this point in the history
  10. WIP: Use MAP_POPULATE

    For benchmarking it's quite annoying that the first time a memory is touched
    has completely different perf characteristics than subsequent accesses. Using
    MAP_POPULATE reduces that substantially.
    anarazel committed Apr 1, 2025
    Configuration menu
    Copy the full SHA
    f5a9dba View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    d824726 View commit details
    Browse the repository at this point in the history
  12. local: iwyu-ify

    anarazel committed Apr 1, 2025
    Configuration menu
    Copy the full SHA
    880fb4e View commit details
    Browse the repository at this point in the history
Loading