Re: Improve logging when using Huge Pages - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: Improve logging when using Huge Pages
Date
Msg-id CAD21AoCp6mbAvrXTTxcKrseYccsCjXFDdr3Vo+natFznpNkNBA@mail.gmail.com
Whole thread Raw
In response to RE: Improve logging when using Huge Pages  ("Shinoda, Noriyoshi (PN Japan FSIP)" <noriyoshi.shinoda@hpe.com>)
Responses Re: Improve logging when using Huge Pages
List pgsql-hackers
On Wed, Oct 27, 2021 at 3:40 PM Shinoda, Noriyoshi (PN Japan FSIP)
<noriyoshi.shinoda@hpe.com> wrote:
>
> Hi,
> 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.
>

I've looked at the patch. Here are comments:

                if (huge_pages == HUGE_PAGES_TRY && ptr == MAP_FAILED)
                        elog(DEBUG1, "mmap(%zu) with MAP_HUGETLB
failed, huge pages disabled: %m",
                                 allocsize);
+               else
+                       with_hugepages = true;

ISTM the name with_hugepages could lead to confusion since it can be
true even if mmap failed and huge_pages == HUGE_PAGES_ON.

Also, with the patch, the log message is emitted also during initdb
and starting up in single user mode:

selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Asia/Tokyo
creating configuration files ... ok
running bootstrap script ... 2021-10-29 15:45:51.408 JST [55101] LOG:
Anonymous shared memory was allocated without huge pages.
ok
performing post-bootstrap initialization ... 2021-10-29 15:45:53.326
JST [55104] LOG:  Anonymous shared memory was allocated without huge
pages.
ok
syncing data to disk ... ok

Which is noisy. Perhaps it's better to log it only when
IsPostmasterEnvironment is true.

Regards,

-- 
Masahiko Sawada
EDB:  https://www.enterprisedb.com/



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: inefficient loop in StandbyReleaseLockList()
Next
From: Amit Langote
Date:
Subject: Re: Multi-Column List Partitioning