0003-Add-CHECK_FOR_INTERRUPTS-into-pg_numa_query_pages.patch
text/x-patch
Filename: 0003-Add-CHECK_FOR_INTERRUPTS-into-pg_numa_query_pages.patch
Type: text/x-patch
Part: 2
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch 0003
Subject: Add CHECK_FOR_INTERRUPTS into pg_numa_query_pages
| File | + | − |
|---|---|---|
| src/port/pg_numa.c | 3 | 0 |
From add3768156d05382b2de1dd64d8c420e8c50f92b Mon Sep 17 00:00:00 2001 From: Tomas Vondra <tomas@vondra.me> Date: Fri, 27 Jun 2025 16:42:43 +0200 Subject: [PATCH 3/3] Add CHECK_FOR_INTERRUPTS into pg_numa_query_pages Querying the NUMA status can be quite time consuming. Thanks to the batching, we can do CHECK_FOR_INTERRUPTS(), to allow users aborting the execution. Reviewed-by: Christoph Berg <myon@debian.org> Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Discussion: https://postgr.es/m/aEtDozLmtZddARdB@msg.df7cb.de --- src/port/pg_numa.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/port/pg_numa.c b/src/port/pg_numa.c index 54ab9c70d56..f76876b2906 100644 --- a/src/port/pg_numa.c +++ b/src/port/pg_numa.c @@ -16,6 +16,7 @@ #include "c.h" #include <unistd.h> +#include "miscadmin.h" #include "port/pg_numa.h" /* @@ -71,6 +72,8 @@ pg_numa_query_pages(int pid, unsigned long count, void **pages, int *status) unsigned long count_batch = Min(count - next, NUMA_QUERY_BATCH_SIZE); + CHECK_FOR_INTERRUPTS(); + /* * Bail out if any of the batches errors out (ret<0). We ignore * (ret>0) which is used to return number of nonmigrated pages, -- 2.49.0