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 1mhuss-0001Q1-2S for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Nov 2021 14:35:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mhusq-0004oq-Lh for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Nov 2021 14:35:28 +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 1mhusq-0004oh-DU for pgsql-hackers@lists.postgresql.org; Tue, 02 Nov 2021 14:35:28 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mhusj-0007HF-Vb for pgsql-hackers@postgresql.org; Tue, 02 Nov 2021 14:35:27 +0000 Received: from hrk.local (p2388012-ipbf1027funabasi.chiba.ocn.ne.jp [118.6.6.12]) by oss.nttdata.com (Postfix) with ESMTPSA id 5049460642; Tue, 2 Nov 2021 23:35:19 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.3 at oss.nttdata.com Subject: Re: Improve logging when using Huge Pages To: "Shinoda, Noriyoshi (PN Japan FSIP)" , "pgsql-hackers@postgresql.org" , Masahiko Sawada Cc: "rjuju123@gmail.com" , "tgl@sss.pgh.pa.us" , Kyotaro Horiguchi , Justin Pryzby References: <80872660-ad16-3040-0a25-bd741faa5fc0@oss.nttdata.com> <20210922002322.GS831@telsasoft.com> <20210927.114023.1519840069762071193.horikyota.ntt@gmail.com> <20211022023815.GI741@telsasoft.com> <64f12586-023b-c6ed-46a8-5251cc81e920@oss.nttdata.com> From: Fujii Masao Message-ID: Date: Tue, 2 Nov 2021 23:35:18 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021/11/02 18:31, Shinoda, Noriyoshi (PN Japan FSIP) wrote: > Fujii-san, Sawada-san, > > Thank you for your comment. > >> Also, with the patch, the log message is emitted also during initdb and starting up in single user mode: > > Certainly the log output when executing the initdb command was a noise. > The attached patch reflects the comments and uses IsPostmasterEnvironment to suppress the output message. Thanks for updating the patch! + ereport(IsPostmasterEnvironment ? LOG : NOTICE, (errmsg("Anonymous shared memory was allocated without huge pages."))); This change causes the log message to be output with NOTICE level even when IsPostmasterEnvironment is false. But do we really want to log that NOTICE message in that case? Instead, isn't it better to just output the log message with LOG level only when IsPostmasterEnvironment is true? Justin and I posted other comments upthread. Could you consider whether it's worth applying those comments to the patch? Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION