| From: | Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com> | 
|---|---|
| To: | Andres Freund <andres(at)anarazel(dot)de> | 
| Cc: | Tomas Vondra <tomas(at)vondra(dot)me>, Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: Draft for basic NUMA observability | 
| Date: | 2025-04-07 18:11:44 | 
| Message-ID: | Z/QVYDzvztbsJ0gq@ip-10-97-1-34.eu-west-3.compute.internal | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
Hi,
On Mon, Apr 07, 2025 at 12:42:21PM -0400, Andres Freund wrote:
> Hi,
> 
> On 2025-04-07 18:36:24 +0200, Tomas Vondra wrote:
> 
> I was thinking of checking if the BufferDesc indicates BM_VALID or
> BM_TAG_VALID.
Yeah, that's what I did propose in [1] (when we were speaking about get_mempolicy())
and I think that would make sense as future improvement.
> 
> 
> > I think we need to decide whether the current patches are good enough
> > for PG18, with the current behavior, and then maybe improve that in
> > PG19.
> 
> I think as long as the docs mention this with <note> or <warning> it's ok for
> now.
+1
A few comments on v27:
=== 1
pg_buffercache_numa() reports the node ID as "nodeid" while pg_shmem_allocations_numa()
reports it as node_id. Maybe we should use the same "naming" in both.
=== 2
postgres=# select count(*) from pg_buffercache;
 count
-------
 65536
(1 row)
but
postgres=# select count(*) from pg_buffercache_numa;
 count
-------
    64
(1 row)
with:
postgres=# show block_size;
 block_size
------------
 2048
and Hugepagesize: 2048 kB.
and
postgres=#  show shared_buffers;
 shared_buffers
----------------
 128MB
(1 row)
And even if for testing I set:
-               funcctx->max_calls = idx;
+               funcctx->max_calls = 65536;
then I start to see weird results:
postgres=# select count(*) from pg_buffercache_numa where bufferid not in (select bufferid from pg_buffercache);
 count
-------
 65472
(1 row)
So it looks like that the new way to iterate on the buffers that has been introduced
in v26/v27 has some issue?
[1]: https://www.postgresql.org/message-id/Z64Pr8CTG0RTrGR3%40ip-10-97-1-34.eu-west-3.compute.internal
Regards,
-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Álvaro Herrera | 2025-04-07 18:15:43 | Re: Modern SHA2- based password hashes for pgcrypto | 
| Previous Message | Andres Freund | 2025-04-07 18:11:28 | Re: Draft for basic NUMA observability |