pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Justin Pryzby <pryzby@telsasoft.com>
To: Shinoda, Noriyoshi (PN Japan FSIP) <noriyoshi.shinoda@hpe.com>
Cc: pgsql-hackers@postgresql.org, rjuju123@gmail.com, tgl@sss.pgh.pa.us, Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Subject: Re: Improve logging when using Huge Pages
Date: Tue, 2 Nov 2021 01:24:36 +0900
Message-ID: <d928cc86-8e03-b481-18f7-2cb9c28fc724@oss.nttdata.com> (raw)
In-Reply-To: <20211028220534.GB31568@telsasoft.com>
References: <TU4PR8401MB1152B1A4158D609472ABD51DEEA09@TU4PR8401MB1152.NAMPRD84.PROD.OUTLOOK.COM>
	<80872660-ad16-3040-0a25-bd741faa5fc0@oss.nttdata.com>
	<20210922002322.GS831@telsasoft.com>
	<20210927.114023.1519840069762071193.horikyota.ntt@gmail.com>
	<TU4PR8401MB11529A0C57CEDCCBC39050EDEEA79@TU4PR8401MB1152.NAMPRD84.PROD.OUTLOOK.COM>
	<20211022023815.GI741@telsasoft.com>
	<TU4PR8401MB11529CCEE0FCC07EEE9F8FA7EE859@TU4PR8401MB1152.NAMPRD84.PROD.OUTLOOK.COM>
	<20211028220534.GB31568@telsasoft.com>



On 2021/10/29 7:05, Justin Pryzby wrote:
> Hi,
> 
> On Wed, Oct 27, 2021 at 06:39:46AM +0000, Shinoda, Noriyoshi (PN Japan FSIP) wrote:
>> Thank you for your comment.
>> The attached patch stops message splitting.
>> This patch also limits the timing of message output when huge_pages = try and HugePages is not used.

The log message should be reported even when huge_pages=off (and huge pages
are not used)? Otherwise we cannot determine whether huge pages are actually
used or not when no such log message is found in the server log.

Or it's simpler and more intuitive to log the message "Anonymous shared
memory was allocated with huge pages" only when huge pages are successfully
requested? If that message is logged, we can determine that huge pages are
used whatever the setting is. OTOH, if there is no such message, we can
determine that huge pages are not used for some reasons, e.g., OS doesn't
support huge pages, shared_memory_type is not set to mmap, etc.


> +       } else if (!with_hugepages && huge_pages == HUGE_PAGES_TRY)
> +               ereport(LOG, (errmsg("Anonymous shared memory was allocated without huge pages.")));
> 
> I would write this as a separate "if".  The preceding block is a terminal FATAL
> and it seems more intuitive that way.

Agreed.


> Should it include an errcode() ?
> ERRCODE_INSUFFICIENT_RESOURCES ?
> ERRCODE_OUT_OF_MEMORY ?

Probably errcode is not necessary here because it's a log message
not error one?

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION





view thread (93+ messages)  latest in thread

Message-ID: <d928cc86-8e03-b481-18f7-2cb9c28fc724@oss.nttdata.com>
Permalink:  ../d928cc86-8e03-b481-18f7-2cb9c28fc724@oss.nttdata.com/
Also on:    postgresql.org/message-id/d928cc86-8e03-b481-18f7-2cb9c28fc724@oss.nttdata.com

 · 

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-hackers@postgresql.org
  Cc: masao.fujii@oss.nttdata.com, pryzby@telsasoft.com, noriyoshi.shinoda@hpe.com, horikyota.ntt@gmail.com
  Subject: Re: Improve logging when using Huge Pages
  In-Reply-To: <d928cc86-8e03-b481-18f7-2cb9c28fc724@oss.nttdata.com>

* 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