Re: [PATCH] Add support for choosing huge page size - Mailing list pgsql-hackers

From Odin Ugedal
Subject Re: [PATCH] Add support for choosing huge page size
Date
Msg-id CAFpoUr2_xLWSE0b-JxmWJ8vVnhYXRoCo-c8iJZ8eKzq0yoH3AQ@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Add support for choosing huge page size  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: [PATCH] Add support for choosing huge page size
List pgsql-hackers
Hi,

Thank you so much for the feedback David and Thomas!

Attached v2 of patch, updated with the comments from Thomas (again,
thanks). I also changed the mmap flags to only set size if the
selected huge page size is not the default on (on linux). The support
for this functionality was added in Linux 3.8, and therefore it was
not supported before then. Should we add that to the docs, or what do
you think? The definitions of MAP_HUGE_MASK and MAP_HUGE_SHIFT were
added in Linux 3.8 too, but since they are a part of libc/musl, and
are "used" at compile time, that shouldn't be a problem, or?

If a huge page size that is not supported on the system is chosen via
huge_page_size (and huge_pages = on), it will result in "FATAL:  could
not map anonymous shared memory: Invalid argument". This is the same
that happens today when huge pages aren't supported at all, so I guess
it is ok for now (and then we can consider verifying that it is
supported at a later stage).

Also, thanks for the information about the Windows. Have been
searching about info on huge pages in windows and "superpages" in bsd,
without that much luck. I only have experience on linux, so I think we
can do as you said, to let someone else look at it. :)

Odin

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: text coverage for EXTRACT()
Next
From: "David G. Johnston"
Date:
Subject: Re: Postgres installer with pgAdmin 4.22