RE: Improve logging when using Huge Pages

From: "Shinoda, Noriyoshi (PN Japan FSIP)" <noriyoshi(dot)shinoda(at)hpe(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Cc: "rjuju123(at)gmail(dot)com" <rjuju123(at)gmail(dot)com>, "tgl(at)sss(dot)pgh(dot)pa(dot)us" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, "Justin Pryzby" <pryzby(at)telsasoft(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Subject: RE: Improve logging when using Huge Pages
Date: 2021-11-08 12:37:48
Message-ID: TU4PR8401MB1152A167C0FD0FB5B8224888EE919@TU4PR8401MB1152.NAMPRD84.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fujii-san,

Thank you for your comment.
As advised by Justin, I modified the comment according to the style guide and split the if statement.
As you say, the NOTICE log was deleted as it may not be needed.

Regards,
Noriyoshi Shinoda
-----Original Message-----
From: Fujii Masao [mailto:masao(dot)fujii(at)oss(dot)nttdata(dot)com]
Sent: Tuesday, November 2, 2021 11:35 PM
To: Shinoda, Noriyoshi (PN Japan FSIP) <noriyoshi(dot)shinoda(at)hpe(dot)com>; pgsql-hackers(at)postgresql(dot)org; Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: rjuju123(at)gmail(dot)com; tgl(at)sss(dot)pgh(dot)pa(dot)us; Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>; Justin Pryzby <pryzby(at)telsasoft(dot)com>
Subject: Re: Improve logging when using Huge Pages

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

Attachment Content-Type Size
huge_pages_log_v9.diff application/octet-stream 1.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2021-11-08 13:14:34 Re: Optionally automatically disable logical replication subscriptions on error
Previous Message Alvaro Herrera 2021-11-08 12:21:13 Re: prevent immature WAL streaming