Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pa25o-0006ql-JK for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Mar 2023 22:17:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pa25n-0005ks-F2 for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Mar 2023 22:17:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pa25n-0005k3-35 for pgsql-hackers@lists.postgresql.org; Wed, 08 Mar 2023 22:17:03 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pa25k-0005cT-KW for pgsql-hackers@postgresql.org; Wed, 08 Mar 2023 22:17:02 +0000 Received: by mail-pj1-x1035.google.com with SMTP id y2so300375pjg.3 for ; Wed, 08 Mar 2023 14:17:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678313819; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=RjpiKZyraaWI6HKxelmTpr7qetlfJ4nuU3dDuGbes74=; b=a68VBqKQ+TnYg6P2wPscrFJi7VphTsV4z4jTVVLNeQ9xwzVFpVjP6QpdgbPjpAOhcd /5jsktr9UJOntvBiA1RkUKIm1FyDjY5sHwXXljuml4rjKitLNDcy84pdwPgToyQVIRiJ imH1JmU3cVcEDenGrBYXZb7ukJWHVgjd2xvRlAhF3fxlTQ1f3lRnPzr4AXMQjfOr/lbs CBmiFcOcmFvxWaxV/aoLxAMBSgOEoJSVCpK9Tf4gn6zIeKASK14vSgtot+18bM/KBBQf BltEIRfB/Gi/TNRBBSw9fcIai+c9Hc+LEHmotKftma8GPaHyzKvioedcimJc395mUhkh rMJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678313819; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RjpiKZyraaWI6HKxelmTpr7qetlfJ4nuU3dDuGbes74=; b=AyrRVWVAITBjkMPVBunOCoy41aEOi5wLPFCstS+O/MbqrK7S6ahQKJ63s8BavrVsYb 9Gev306jfYUL+bCVfHDV8dfeuOK3n5CGbT0ebnl2gE4wZIdzY8olyQ3iSHZfg8fB+PJw e1RCj8Q26i5WRU7KYTB/UTVRWIZZVVChmdGDK3RuH1EnR+SNz8FHGhno1L7m7r9xLGxc m6LrbpXsQp2epyQ/ACz85YTPFS8KEb0vIf6HWZmOouYSKLxjnjdR7ftx2+TihxNjsDTL Dou1iOSwdcWl2KISs8rD3ajCB7JsM+zgwYT3wiZqQUozkRVVweJtKfWjVHzE9Nx/qF/o wRkQ== X-Gm-Message-State: AO0yUKUq+49vDBT1nj96+OE5Mh6GofbSKDkMGLwRg1RDgBLIeey8SYeL RQoPHs217DcMp29yMCQIHx8= X-Google-Smtp-Source: AK7set+7E65OY2vdDoP/2pkhQqDrzjX2GGqP/5cBLON3SEMc/pvQ17gSFEIIqAk7XZjfJFrYx4Sd7w== X-Received: by 2002:a17:903:120c:b0:19e:cfbf:f68d with SMTP id l12-20020a170903120c00b0019ecfbff68dmr11180075plh.23.1678313819145; Wed, 08 Mar 2023 14:16:59 -0800 (PST) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id y2-20020a170902ed4200b0019b0afc24e8sm10257421plb.250.2023.03.08.14.16.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 14:16:58 -0800 (PST) Date: Wed, 8 Mar 2023 14:16:56 -0800 From: Nathan Bossart To: Justin Pryzby Cc: Alvaro Herrera , Andres Freund , Michael Paquier , Kyotaro Horiguchi , 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 Subject: Re: Improve logging when using Huge Pages Message-ID: <20230308221656.GA3621885@nathanxps13> References: <20230208231803.GP1653@telsasoft.com> <20230209094013.67varf63bihops33@alvherre.pgsql> <20230209192909.GA606606@nathanxps13> <20230213232245.GI1653@telsasoft.com> <20230214041852.GA1190218@nathanxps13> <20230215013256.GP1653@telsasoft.com> <20230215181317.GA1353037@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230215181317.GA1353037@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Feb 15, 2023 at 10:13:17AM -0800, Nathan Bossart wrote: > On Tue, Feb 14, 2023 at 07:32:56PM -0600, Justin Pryzby wrote: >> On Mon, Feb 13, 2023 at 08:18:52PM -0800, Nathan Bossart wrote: >>> 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. >> >> It takes more code to write as an enum - see 002.txt. I'm not convinced >> this is better. >> >> But your comment made me fix its , and reconsider the strings, >> which I changed to active={unknown/true/false} rather than {unk/on/off}. >> It could also be active={unknown/yes/no}... > > I think unknown/true/false is fine. I'm okay with using a string if no one > else thinks it should be an enum (or a bool). There's been no response for this, so I guess we can proceed with a string GUC. + Reports whether huge pages are in use by the current instance. + See for more information. I still think we should say "server" in place of "current instance" 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 + }, I don't think we need to use GUC_RUNTIME_COMPUTED. 'postgres -C' seems to always report "unknown" for this GUC, so all this would do is cause that command to error unnecessarily when the server is running. It might be worth documenting exactly what "unknown" means. IIUC you'll only ever see "on" or "off" via SHOW or pg_settings, which doesn't seem tremendously obvious. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com