Add CHECK_FOR_INTERRUPTS into pg_numa_query_pages
authorTomas Vondra <tomas.vondra@postgresql.org>
Tue, 1 Jul 2025 10:58:35 +0000 (12:58 +0200)
committerTomas Vondra <tomas.vondra@postgresql.org>
Tue, 1 Jul 2025 10:59:03 +0000 (12:59 +0200)
commit54ac4944c36f8f6cfc4deaa3f828118b564e1d3d
tree7cce5ee37016f4114b05558077c034939b4b4f98
parent14e52227e57885d1a983d9f2515b569d3180c93d
Add CHECK_FOR_INTERRUPTS into pg_numa_query_pages

Querying the NUMA status can be quite time consuming, especially with
large shared buffers. 8cc139bec34a called numa_move_pages() once, for
all buffers, and we had to wait for the syscall to complete.

But with the chunking, introduced by 7fe2f67c7c 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
src/port/pg_numa.c