Skip to content

Commit bf1119d

Browse files
committed
Add CHECK_FOR_INTERRUPTS into pg_numa_query_pages
Querying the NUMA status can be quite time consuming, especially with large shared buffers. 8cc139b called numa_move_pages() once, for all buffers, and we had to wait for the syscall to complete. But with the chunking, introduced by 7fe2f67 to work around a kernel bug, we can do CHECK_FOR_INTERRUPTS() after each chunk, allowing users to abort 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 Backpatch-through: 18
1 parent 81f287d commit bf1119d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/port/pg_numa.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "c.h"
1717
#include <unistd.h>
1818

19+
#include "miscadmin.h"
1920
#include "port/pg_numa.h"
2021

2122
/*
@@ -76,6 +77,8 @@ pg_numa_query_pages(int pid, unsigned long count, void **pages, int *status)
7677
unsigned long count_chunk = Min(count - next,
7778
NUMA_QUERY_CHUNK_SIZE);
7879

80+
CHECK_FOR_INTERRUPTS();
81+
7982
/*
8083
* Bail out if any of the chunks errors out (ret<0). We ignore
8184
* (ret>0) which is used to return number of nonmigrated pages,

0 commit comments

Comments
 (0)