Re: [PATCH] Add support for choosing huge page size - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: [PATCH] Add support for choosing huge page size
Date
Msg-id CA+hUKGKRaM9jZk9OmeXVf52u4HM1Ks=Q9w0wTB+MpHMd5t-NAQ@mail.gmail.com
Whole thread Raw
In response to [PATCH] Add support for choosing huge page size  (Odin Ugedal <odin@ugedal.com>)
Responses Re: [PATCH] Add support for choosing huge page size
List pgsql-hackers
On Tue, Jun 9, 2020 at 4:13 AM Odin Ugedal <odin@ugedal.com> wrote:
> This adds support for using non-default huge page sizes for shared
> memory. This is achived via the new "huge_page_size" config entry.
> The config value defaults to 0, meaning it will use the system default.
> ---
>
> This would be very helpful when running in kubernetes since nodes may
> support multiple huge page sizes, and have pre-allocated huge page meory
> for each size. This lets the user select huge page size without having
> to change the default huge page size on the node. This will also be
> useful when doing benchmarking with different huge page sizes, since it
> wouldn't require a full system reboot.

+1

> Since the default value of the new config is 0 (resulting in using the
> default huge page size) this should be backwards compatible with old
> configs.

+1

> Feel free to comment on the phrasing (both in docs and code) and on the
> overall change.

This change seems good to me, because it will make testing easier and
certain mixed page size configurations possible.  I haven't tried your
patch yet; I'll take it for a spin when I'm benchmarking some other
relevant stuff soon.

Minor comments on wording:

> +       <para>
> +        Most modern linux systems support <literal>2MB</literal> and <literal>1GB</literal>
> +        huge pages, and some architectures supports other sizes as well. For more information
> +        on how to check for support and usage, see <xref linkend="linux-huge-pages"/>.

Linux with a capital L.  Hmm, I don't especially like saying "Most
modern Linux systems" as code for Intel.  I wonder if we should
instead say something like: "Some commonly available page sizes on
modern 64 bit server architectures include: <literal>2MB<literal> and
<literal>1GB</literal> (Intel and AMD), <literal>16MB</literal> and
<literal>16GB</literal> (IBM POWER), and ... (ARM)."

> +       </para>
> +       <para>
> +        Controling huge page size is not supported on Windows.

Controlling

Just by the way, some googling is telling me that very recent versions
of Windows *could* support this (search keywords:
"NtAllocateVirtualMemoryEx 1GB"), so that could be a project for
someone who understands Windows to look into later.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: valgrind versus pg_atomic_init()
Next
From: Andres Freund
Date:
Subject: Remove SpinLockFree() / S_LOCK_FREE()?