Re: pgsql: Introduce pg_shmem_allocations_numa view

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Christoph Berg <myon(at)debian(dot)org>
Cc: Tomas Vondra <tomas(at)vondra(dot)me>, Andres Freund <andres(at)anarazel(dot)de>, Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Introduce pg_shmem_allocations_numa view
Date: 2025-06-26 05:28:22
Message-ID: aFzadttaX+Qnb5s3@ip-10-97-1-34.eu-west-3.compute.internal
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Hi,

On Wed, Jun 25, 2025 at 11:00:38AM +0200, Christoph Berg wrote:
> Re: Bertrand Drouvot
> > +/*
> > + * Work around Linux kernel bug in 32-bit compat mode: do_pages_stat() has
> > + * incorrect pointer arithmetic for more than DO_PAGES_STAT_CHUNK_NR pages.
> > + */
> > +#if SIZEOF_SIZE_T == 4
>
> I was also missing it in my suggested patch draft, but this should
> probably include #ifdef __linux__.

I'm not sure because the workaround is after this part of the code in pg_numa.c:

"
/*
* At this point we provide support only for Linux thanks to libnuma, but in
* future support for other platforms e.g. Win32 or FreeBSD might be possible
* too. For Win32 NUMA APIs see
* https://learn.microsoft.com/en-us/windows/win32/procthread/numa-support
*/
#ifdef USE_LIBNUMA
"

So I guess that the "#ifdef __linux__" would have to be at a higher level anyway
(should we support NUMA on more than Linux in the future).

Regards,

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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Bertrand Drouvot 2025-06-26 06:00:59 Re: pgsql: Introduce pg_shmem_allocations_numa view
Previous Message Richard Guo 2025-06-26 03:18:32 pgsql: Expand virtual generated columns for ALTER COLUMN TYPE

Browse pgsql-hackers by date

  From Date Subject
Next Message Shinya Kato 2025-06-26 05:35:34 Re: Extend COPY FROM with HEADER <integer> to skip multiple lines
Previous Message Peter Smith 2025-06-26 05:17:00 DOCS: ALTER PUBLICATION - Synopsis for DROP is a bit misleading