Re: pgsql: Introduce pg_shmem_allocations_numa view

Tomas Vondra <tomas@vondra.me>

From: Tomas Vondra <tomas@vondra.me>
To: Álvaro Herrera <alvherre@kurilemu.de>
Cc: Jakub Wartak <jakub.wartak@enterprisedb.com>, Christoph Berg <myon@debian.org>, Bertrand Drouvot <bertranddrouvot.pg@gmail.com>, Andres Freund <andres@anarazel.de>, Tomas Vondra <tomas.vondra@postgresql.org>, pgsql-hackers@lists.postgresql.org
Date: 2025-06-25T12:53:41Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Handle EPERM in pg_numa_init

  2. Add CHECK_FOR_INTERRUPTS into pg_numa_query_pages

  3. Silence valgrind about pg_numa_touch_mem_if_required

  4. Limit the size of numa_move_pages requests

  5. Introduce pg_shmem_allocations_numa view

Attachments


On 6/25/25 14:42, Álvaro Herrera wrote:
> On 2025-Jun-25, Tomas Vondra wrote:
> 
>> Not sure. I thought NUMA doesn't matter very much on 32-bit systems too,
>> exactly because those systems tend to use small amounts of memory. But
>> then while investigating this issue I realized even rpi5 has NUMA, in
>> fact it has a whopping 8 nodes:
>>
>> debian@raspberry-32:~ $ numactl --hardware
>> available: 8 nodes (0-7)
> 
> Interesting.  Mine only shows a single node.
> 
> alvherre@amras:~ $ uname -a
> Linux amras 6.12.25+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.12.25-1+rpt1 (2025-04-30) aarch64 GNU/Linux
> alvherre@amras:~ $ sudo numactl --hardware
> available: 1 nodes (0)
> node 0 cpus: 0 1 2 3
> node 0 size: 8051 MB
> node 0 free: 202 MB
> node distances:
> node   0 
>   0:  10 
> alvherre@amras:~ $ sudo lscpu 
> Architecture:             aarch64
>   CPU op-mode(s):         32-bit, 64-bit
>   Byte Order:             Little Endian
> CPU(s):                   4
>   On-line CPU(s) list:    0-3
> Vendor ID:                ARM
>   Model name:             Cortex-A76
>     Model:                1
>     Thread(s) per core:   1
>     Core(s) per cluster:  4
>     Socket(s):            -
>     Cluster(s):           1
>     Stepping:             r4p1
>     CPU(s) scaling MHz:   62%
>     CPU max MHz:          2400.0000
>     CPU min MHz:          1500.0000
>     BogoMIPS:             108.00
>     Flags:                fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp
>                            asimdhp cpuid asimdrdm lrcpc dcpop asimddp
> [...]
> NUMA:                     
>   NUMA node(s):           1
>   NUMA node0 CPU(s):      0-3
> 
> 
> Did you enable something special on it maybe?
> 
> ... Oh, I found this:
> https://www.jeffgeerling.com/blog/2024/numa-emulation-speeds-pi-5-and-other-improvements
> Sounds like you have this in your system and I don't in mine.
> 

I don't think I had to enable anything special. On the machine running
32-bit RaspberryPi OS I had to install a newer kernel, but I don't
recall doing anything else. I certainly did not apply any kernel patches
or anything like that.

And it seems one of the rpi machines has exactly the same kernel version:

Linux raspberry-64 6.12.25+rpt-rpi-2712 #1 SMP PREEMPT Debian
1:6.12.25-1+rpt1 (2025-04-30) aarch64 GNU/Linux

So I wonder what's going on, why there's no NUMA on your rpi.


-- 
Tomas Vondra