On 01/07/2025 14:03, Tomas Vondra wrote:
Thanks! Pushed, with both adjustments (link to kernel thread, adding the
commit hash).
I just noticed that this (commit bf1119d74a: Add CHECK_FOR_INTERRUPTS into pg_numa_query_pages) made the function unusable in frontend programs, because CHECK_FOR_INTERRUPTS is server only. It's not used in frontend programs today, but it was placed in src/port/ with the idea that it could be.

That's pretty easy to fix by wrapping it in an "#ifndef FRONTEND" block, per attached.

- Heikki
From 92e66ea5f17cacfb3408d2af51b9d24d4413cc9e Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas <[email protected]>
Date: Thu, 12 Feb 2026 16:11:44 +0200
Subject: [PATCH 1/1] Make pg_numa_query_pages() work in frontend programs

It's currently only used in the server, but it was placed in src/port
with the idea that it might be useful in client programs too. However,
it will currently fail to link if used in a client program, because
CHECK_FOR_INTERRUPTS() is not usable in client programs. Fix that by
wrapping it in "#ifndef FRONTEND".
---
 src/port/pg_numa.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/port/pg_numa.c b/src/port/pg_numa.c
index d574a686b42..8954669273a 100644
--- a/src/port/pg_numa.c
+++ b/src/port/pg_numa.c
@@ -87,7 +87,9 @@ pg_numa_query_pages(int pid, unsigned long count, void **pages, int *status)
 		unsigned long count_chunk = Min(count - next,
 										NUMA_QUERY_CHUNK_SIZE);
 
+#ifndef FRONTEND
 		CHECK_FOR_INTERRUPTS();
+#endif
 
 		/*
 		 * Bail out if any of the chunks errors out (ret<0). We ignore (ret>0)
-- 
2.47.3

Reply via email to