Re: Draft for basic NUMA observability - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: Draft for basic NUMA observability
Date
Msg-id Z/Ogk1COuOo4DR+B@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: Draft for basic NUMA observability  (Jakub Wartak <jakub.wartak@enterprisedb.com>)
Responses Re: Draft for basic NUMA observability
List pgsql-hackers
Hi,

On Mon, Apr 07, 2025 at 10:09:26AM +0200, Jakub Wartak wrote:
> Bertrand noticed this first in
> https://www.postgresql.org/message-id/Z/FhOOCmTxuB2h0b%40ip-10-97-1-34.eu-west-3.compute.internal
> :
> 
> -               startptr = (char *) BufferGetBlock(1);
> +               startptr = (char *) TYPEALIGN_DOWN(os_page_size, (char
> *) BufferGetBlock(1));
> 
> With the above I'm also not getting wonky (-1) results anymore. The
> rest of reply assumes we are using this.

yeah, I can see that you added it in v25-0007. In the same message I mentioned
to "use the actual buffer address when pg_numa_touch_mem_if_required()
is called?"

So, to be extra cautious we could do something like:

@@ -474,7 +474,7 @@ pg_buffercache_numa_pages(PG_FUNCTION_ARGS)

                                /* Only need to touch memory once per backend process lifetime */
                                if (firstNumaTouch)
-                                       pg_numa_touch_mem_if_required(touch, os_page_ptrs[idx]);
+                                       pg_numa_touch_mem_if_required(touch, buffptr + (j * os_page_size));


what do you think?

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Etsuro Fujita
Date:
Subject: Re: Typo in comment for pgstat_database_flush_cb()
Next
From: Bertrand Drouvot
Date:
Subject: Re: Fix 035_standby_logical_decoding.pl race conditions