Re: Improve logging when using Huge Pages

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, Andres Freund <andres@anarazel.de>, Michael Paquier <michael@paquier.xyz>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, thomas.munro@gmail.com, tgl@sss.pgh.pa.us, john.naylor@enterprisedb.com, noriyoshi.shinoda@hpe.com, jchampion@timescale.com, sawada.mshk@gmail.com, masao.fujii@oss.nttdata.com, pgsql-hackers@postgresql.org, rjuju123@gmail.com
Date: 2023-02-14T04:18:52Z
Lists: pgsql-hackers
On Mon, Feb 13, 2023 at 05:22:45PM -0600, Justin Pryzby wrote:
> +        Reports whether huge pages are in use by the current process.
> +        See <xref linkend="guc-huge-pages"/> for more information.

nitpick: Should this say "server" instead of "current process"?

> +static char *huge_pages_active = "unknown"; /* dynamically set */

nitpick: Does this need to be initialized here?

> +	{
> +		{"huge_pages_active", PGC_INTERNAL, PRESET_OPTIONS,
> +			gettext_noop("Indicates whether huge pages are in use."),
> +			NULL,
> +			GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE | GUC_RUNTIME_COMPUTED
> +		},
> +		&huge_pages_active,
> +		"unknown",
> +		NULL, NULL, NULL
> +	},

I'm curious why you chose to make this a string instead of an enum.  There
might be little practical difference, but since there are only three
possible values, I wonder if it'd be better form to make it an enum.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add GUC parameter "huge_pages_status"

  2. Add check on initial and boot values when loading GUCs

  3. Clean up some inconsistencies with GUC declarations

  4. Clean up some GUC declarations and comments