pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add GUC parameter "huge_pages_status"
Date: Thu, 06 Jul 2023 05:43:39 +0000
Message-ID: <E1qHHmF-00295N-Mu@gemulon.postgresql.org> (raw)

Add GUC parameter "huge_pages_status"

This is useful to show the allocation state of huge pages when setting
up a server with "huge_pages = try", where allocating huge pages would
be attempted but the server would continue its startup sequence even if
the allocation fails.  The effective status of huge pages is not easily
visible without OS-level tools (or for instance, a lookup at
/proc/N/smaps), and the environments where Postgres runs may not
authorize that.  Like the other GUCs related to huge pages, this works
for Linux and Windows.

This GUC can report as values:
- "on", if huge pages were allocated.
- "off", if huge pages were not allocated.
- "unknown", a special state that could only be seen when using for
example postgres -C because it is only possible to know if the shared
memory allocation worked after we can check for the GUC values, even if
checking a runtime-computed GUC.  This value should never be seen when
querying for the GUC on a running server.  An assertion is added to
check that.

The discussion has also turned around having a new function to grab this
status, but this would have required more tricks for -DEXEC_BACKEND,
something that GUCs already handle.

Noriyoshi Shinoda has initiated the thread that has led to the result of
this commit.

Author: Justin Pryzby
Reviewed-by: Nathan Bossart, Kyotaro Horiguchi, Michael Paquier
Discussion: https://postgr.es/m/TU4PR8401MB1152EBB0D271F827E2E37A01EECC9@TU4PR8401MB1152.NAMPRD84.PROD.OUTLOOK.C...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a14354cac0e32d5e169c1ea4225845f93922d483

Modified Files
--------------
doc/src/sgml/config.sgml              | 23 ++++++++++++++++++++++-
src/backend/port/sysv_shmem.c         | 14 ++++++++++++++
src/backend/port/win32_shmem.c        |  5 +++++
src/backend/storage/ipc/ipci.c        |  7 +++++++
src/backend/utils/misc/guc_tables.c   | 19 +++++++++++++++++++
src/include/storage/pg_shmem.h        |  5 +++--
src/test/authentication/t/003_peer.pl |  6 ++++++
src/test/authentication/t/005_sspi.pl |  4 ++++
8 files changed, 80 insertions(+), 3 deletions(-)



Message-ID: <E1qHHmF-00295N-Mu@gemulon.postgresql.org>
Permalink:  ../E1qHHmF-00295N-Mu@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qHHmF-00295N-Mu@gemulon.postgresql.org

 · 

reply

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-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add GUC parameter "huge_pages_status"
  In-Reply-To: <E1qHHmF-00295N-Mu@gemulon.postgresql.org>

* 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