Re: Improve logging when using Huge Pages - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Improve logging when using Huge Pages
Date
Msg-id ZBfnFs8hBIDUuaXA@paquier.xyz
Whole thread Raw
In response to Re: Improve logging when using Huge Pages  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: Improve logging when using Huge Pages  (Michael Paquier <michael@paquier.xyz>)
Re: Improve logging when using Huge Pages  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, Mar 14, 2023 at 02:02:19PM +0900, Kyotaro Horiguchi wrote:
> Regarding huge_page_active, its value remains constant throughout a
> postmaster's lifespan. In this regard, GUC may be a better fit for
> this information.  The issue with using GUC for this value is that the
> postgres command cannot report the final value via the -C option,
> which may be the reason for the third alternative "unknown".
>
> I slightly prefer using a function for this, as if GUC is used, it can
> only return "unknown" for the command "postgres -C
> huge_page_active". However, apart from this advantage, I prefer using
> a GUC for this information.

The main advantage of a read-only GUC over a function is that users
would not need to start a postmaster to know if huge pages would be
active or not.  This is the main reason why a GUC would be a better
fit, in my opinion, because it makes for a cheaper check, while still
allowing a SQL query to check the value of the GUC.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Initial Schema Sync for Logical Replication
Next
From: Michael Paquier
Date:
Subject: Re: Improve logging when using Huge Pages