postgres/contrib/pg_buffercache
Tomas Vondra 81f287dc92 Silence valgrind about pg_numa_touch_mem_if_required
When querying NUMA status of pages in shared memory, we need to touch
the memory first to get valid results. This may trigger valgrind
reports, because some of the memory (e.g. unpinned buffers) may be
marked as noaccess.

Solved by adding a valgrind suppresion. An alternative would be to
adjust the access/noaccess status before touching the memory, but that
seems far too invasive. It would require all those places to have
detailed knowledge of what the shared memory stores.

The pg_numa_touch_mem_if_required() macro is replaced with a function.
Macros are invisible to suppressions, so it'd have to suppress reports
for the caller - e.g. pg_get_shmem_allocations_numa(). So we'd suppress
reports for the whole function, and that seems to heavy-handed. It might
easily hide other valid issues.

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
2025-07-01 12:32:23 +02:00
..
expected Add pg_buffercache_evict_{relation,all} functions 2025-04-08 02:19:32 -04:00
sql Add pg_buffercache_evict_{relation,all} functions 2025-04-08 02:19:32 -04:00
.gitignore Add regression test coverage for contrib/pg_buffercache. 2022-07-30 15:33:44 -04:00
Makefile Add pg_buffercache_numa view with NUMA node info 2025-04-07 23:08:17 +02:00
meson.build Add pg_buffercache_numa view with NUMA node info 2025-04-07 23:08:17 +02:00
pg_buffercache_pages.c Silence valgrind about pg_numa_touch_mem_if_required 2025-07-01 12:32:23 +02:00
pg_buffercache--1.1--1.2.sql Update pg_buffercache extension for parallel query. 2016-06-09 17:18:12 -04:00
pg_buffercache--1.2--1.3.sql Default monitoring roles 2017-03-30 14:18:53 -04:00
pg_buffercache--1.2.sql Update pg_buffercache extension for parallel query. 2016-06-09 17:18:12 -04:00
pg_buffercache--1.3--1.4.sql Add pg_buffercache_usage_counts() to contrib/pg_buffercache. 2023-04-07 14:25:53 -04:00
pg_buffercache--1.4--1.5.sql Add pg_buffercache_evict() function for testing. 2024-04-08 16:23:40 +12:00
pg_buffercache--1.5--1.6.sql pg_buffercache: Change page_num type to bigint 2025-04-08 12:38:42 +02:00
pg_buffercache--1.0--1.1.sql
pg_buffercache.control Add pg_buffercache_numa view with NUMA node info 2025-04-07 23:08:17 +02:00