agora inbox for pgsql-committers@postgresql.orghelp / color / mirror / Atom feed
[PATCH v2] Accept unmapped NUMA pages 4+ messages / 2 participants [nested] [flat]
* [PATCH v2] Accept unmapped NUMA pages @ 2025-06-23 15:50 Christoph Berg <myon@debian.org> 0 siblings, 0 replies; 4+ messages in thread From: Christoph Berg @ 2025-06-23 15:50 UTC (permalink / raw) We are touching all shared memory pages so move_pages can report their status from our address space, but this might still leave some status numbers to be negative error codes; -14 (EFAULT) was seen on 32-bit Linux. Instead of erroring out, skip over these entries. --- src/backend/storage/ipc/shmem.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/backend/storage/ipc/shmem.c b/src/backend/storage/ipc/shmem.c index c9ae3b45b76..21c1e5b2d62 100644 --- a/src/backend/storage/ipc/shmem.c +++ b/src/backend/storage/ipc/shmem.c @@ -700,13 +700,8 @@ pg_get_shmem_allocations_numa(PG_FUNCTION_ARGS) int s = pages_status[i]; /* Ensure we are adding only valid index to the array */ - if (s < 0 || s > max_nodes) - { - elog(ERROR, "invalid NUMA node id outside of allowed range " - "[0, " UINT64_FORMAT "]: %d", max_nodes, s); - } - - nodes[s]++; + if (s >= 0 && s <= max_nodes) + nodes[s]++; } /* -- 2.47.2 --nT8dEFd4v/xnwLii-- ^ permalink raw reply [nested|flat] 4+ messages in thread
* [PATCH v2] Accept unmapped NUMA pages @ 2025-06-23 15:50 Christoph Berg <myon@debian.org> 0 siblings, 0 replies; 4+ messages in thread From: Christoph Berg @ 2025-06-23 15:50 UTC (permalink / raw) We are touching all shared memory pages so move_pages can report their status from our address space, but this might still leave some status numbers to be negative error codes; -14 (EFAULT) was seen on 32-bit Linux. Instead of erroring out, skip over these entries. --- src/backend/storage/ipc/shmem.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/backend/storage/ipc/shmem.c b/src/backend/storage/ipc/shmem.c index c9ae3b45b76..21c1e5b2d62 100644 --- a/src/backend/storage/ipc/shmem.c +++ b/src/backend/storage/ipc/shmem.c @@ -700,13 +700,8 @@ pg_get_shmem_allocations_numa(PG_FUNCTION_ARGS) int s = pages_status[i]; /* Ensure we are adding only valid index to the array */ - if (s < 0 || s > max_nodes) - { - elog(ERROR, "invalid NUMA node id outside of allowed range " - "[0, " UINT64_FORMAT "]: %d", max_nodes, s); - } - - nodes[s]++; + if (s >= 0 && s <= max_nodes) + nodes[s]++; } /* -- 2.47.2 --nT8dEFd4v/xnwLii-- ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Fixes for SPI "const Datum *" use @ 2026-06-30 12:57 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 4+ messages in thread From: Peter Eisentraut @ 2026-06-30 12:57 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fixes for SPI "const Datum *" use Fixup for commit 8a27d418f8f, which converted many functions to use "const Datum *" instead of "Datum *", including some SPI functions. For SPI_cursor_open(), the code was updated but not the documentation. For SPI_cursor_open_with_args(), the documentation was updated but not the code. (Possibly, these two were confused with each other.) Also, SPI_execp() and SPI_modifytuple() were not updated, even though they are closely related to the functions touched by the previous commit and now look inconsistent. Fix all these. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/86b5162f-c472-40fa-997b-0450dece1dec%40eisentraut.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/cd3ad3bc03567ee120a638c840112b8865e055a8 Modified Files -------------- doc/src/sgml/spi.sgml | 6 +++--- src/backend/executor/spi.c | 6 +++--- src/include/executor/spi.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Fixes for SPI "const Datum *" use @ 2026-06-30 12:57 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 4+ messages in thread From: Peter Eisentraut @ 2026-06-30 12:57 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fixes for SPI "const Datum *" use Fixup for commit 8a27d418f8f, which converted many functions to use "const Datum *" instead of "Datum *", including some SPI functions. For SPI_cursor_open(), the code was updated but not the documentation. For SPI_cursor_open_with_args(), the documentation was updated but not the code. (Possibly, these two were confused with each other.) Also, SPI_execp() and SPI_modifytuple() were not updated, even though they are closely related to the functions touched by the previous commit and now look inconsistent. Fix all these. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/86b5162f-c472-40fa-997b-0450dece1dec%40eisentraut.org Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2fb6015f78749c3a235354acded31562414775be Modified Files -------------- doc/src/sgml/spi.sgml | 6 +++--- src/backend/executor/spi.c | 6 +++--- src/include/executor/spi.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2026-06-30 12:57 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2025-06-23 15:50 [PATCH v2] Accept unmapped NUMA pages Christoph Berg <myon@debian.org> 2025-06-23 15:50 [PATCH v2] Accept unmapped NUMA pages Christoph Berg <myon@debian.org> 2026-06-30 12:57 pgsql: Fixes for SPI "const Datum *" use Peter Eisentraut <peter@eisentraut.org> 2026-06-30 12:57 pgsql: Fixes for SPI "const Datum *" use Peter Eisentraut <peter@eisentraut.org>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox