summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Paquier2025-06-05 00:39:24 +0000
committerMichael Paquier2025-06-05 00:39:24 +0000
commitb87163e5f3847730ee5f59718d215c6e63e13bff (patch)
treee2ae8378461c1a0644e9acd65d553a0af0c895c1
parentf9b1192190aac56a319a1e3e93cf3c29d9f722dd (diff)
Fix copy-pasto with process count calculation in method_io_uring.c
This commit replaces the formula used for "TotalProcs" with a call to pgaio_uring_procs() in pgaio_uring_shmem_init() for the shared memory initialization, which is exactly the same, removing a duplication. pgaio_uring_procs() is used for shared memory sizing and a sanity check, and it has some documentation explaining some reasoning behind the formula. Author: Japin Li <[email protected]> Discussion: https://postgr.es/m/ME0P300MB044521067A1EDDA9EDEC3793B66DA@ME0P300MB0445.AUSP300.PROD.OUTLOOK.COM
-rw-r--r--src/backend/storage/aio/method_io_uring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/storage/aio/method_io_uring.c b/src/backend/storage/aio/method_io_uring.c
index c719ba2727a..cc312b641ca 100644
--- a/src/backend/storage/aio/method_io_uring.c
+++ b/src/backend/storage/aio/method_io_uring.c
@@ -126,7 +126,7 @@ pgaio_uring_shmem_size(void)
static void
pgaio_uring_shmem_init(bool first_time)
{
- int TotalProcs = MaxBackends + NUM_AUXILIARY_PROCS - MAX_IO_WORKERS;
+ int TotalProcs = pgaio_uring_procs();
bool found;
pgaio_uring_contexts = (PgAioUringContext *)