From: Justin Pryzby <pryzby@telsasoft.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: sfrost@snowman.net
Cc: alvherre@alvh.no-ip.org
Cc: andres@anarazel.de
Cc: nathandbossart@gmail.com
Cc: jchampion@timescale.com
Cc: john.naylor@enterprisedb.com
Cc: masao.fujii@oss.nttdata.com
Cc: noriyoshi.shinoda@hpe.com
Cc: pgsql-hackers@postgresql.org
Cc: rjuju123@gmail.com
Cc: sawada.mshk@gmail.com
Cc: tgl@sss.pgh.pa.us
Cc: thomas.munro@gmail.com
Subject: Re: Improve logging when using Huge Pages
Date: Wed, 22 Mar 2023 17:18:28 -0500
Message-ID: <ZBt+tCS/Akj8BvHi@telsasoft.com> (raw)
In-Reply-To: <ZBqwHY7yZQATAp9N@paquier.xyz>
References: <ZBfsbTEUnRcEyNao@paquier.xyz>
<ZBplvQx7n0MGVr6O@telsasoft.com>
<ZBqwHY7yZQATAp9N@paquier.xyz>
On Wed, Mar 22, 2023 at 04:37:01PM +0900, Michael Paquier wrote:
> I have noted something.. For the WIN32 case, we have that:
>
> +++ b/src/backend/port/win32_shmem.c
> @@ -327,6 +327,8 @@ retry:
> Sleep(1000);
> continue;
> }
> +
> + huge_pages_active = ((flProtect & SEC_LARGE_PAGES) != 0);
> break;
>
> Are you sure that this is correct? This is set in
> PGSharedMemoryCreate(), part of CreateSharedMemoryAndSemaphores() in
> the startup sequence that creates the shmem segment. However, for a
> normal backend created by EXEC_BACKEND, SubPostmasterMain() reattaches
> to an existing shared memory segment, so we don't go through the
> creation path that would set huge_pages_active for the process just
> started, (note that InitPostmasterChild() switches IsUnderPostmaster,
> bypassing the shmem segment creation).
Wow, good point. I think to make it work we'd need put
huge_pages_active into BackendParameters and handle it in
save_backend_variables(). If so, that'd be strong argument for using a
GUC, which already has all the necessary infrastructure for exposing the
server's state.
--
Justin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: pryzby@telsasoft.com, michael@paquier.xyz, horikyota.ntt@gmail.com, sfrost@snowman.net, alvherre@alvh.no-ip.org, andres@anarazel.de, nathandbossart@gmail.com, jchampion@timescale.com, john.naylor@enterprisedb.com, masao.fujii@oss.nttdata.com, noriyoshi.shinoda@hpe.com, rjuju123@gmail.com, sawada.mshk@gmail.com, tgl@sss.pgh.pa.us, thomas.munro@gmail.com
Subject: Re: Improve logging when using Huge Pages
In-Reply-To: <ZBt+tCS/Akj8BvHi@telsasoft.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox