-
Notifications
You must be signed in to change notification settings - Fork 5k
Comparing changes
Open a pull request
base repository: postgres/postgres
base: master
head repository: anarazel/postgres
compare: aio-2
- 12 commits
- 44 files changed
- 2 contributors
Commits on Apr 1, 2025
-
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
Configuration menu - View commit details
-
Copy full SHA for bddd73d - Browse repository at this point
Copy the full SHA bddd73dView commit details -
aio: Experimental heuristics to increase batching in read_stream.c
Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch:
Configuration menu - View commit details
-
Copy full SHA for a97261d - Browse repository at this point
Copy the full SHA a97261dView commit details -
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
Configuration menu - View commit details
-
Copy full SHA for aed463d - Browse repository at this point
Copy the full SHA aed463dView commit details -
Configuration menu - View commit details
-
Copy full SHA for aab6be7 - Browse repository at this point
Copy the full SHA aab6be7View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 39400ae - Browse repository at this point
Copy the full SHA 39400aeView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 66d2e25 - Browse repository at this point
Copy the full SHA 66d2e25View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 5097acd - Browse repository at this point
Copy the full SHA 5097acdView commit details -
Ensure a resowner exists for all paths that may perform AIO
Reviewed-by: Noah Misch <[email protected]> Discussion: https://postgr.es/m/[email protected]
Configuration menu - View commit details
-
Copy full SHA for 1ad522c - Browse repository at this point
Copy the full SHA 1ad522cView commit details -
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:
Configuration menu - View commit details
-
Copy full SHA for 2ed454d - Browse repository at this point
Copy the full SHA 2ed454dView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for f5a9dba - Browse repository at this point
Copy the full SHA f5a9dbaView commit details -
Configuration menu - View commit details
-
Copy full SHA for d824726 - Browse repository at this point
Copy the full SHA d824726View commit details -
Configuration menu - View commit details
-
Copy full SHA for 880fb4e - Browse repository at this point
Copy the full SHA 880fb4eView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff master...aio-2