pgsql: Fix huge_pages on Windows

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix huge_pages on Windows
Date: 2022-09-17 06:40:25
Message-ID: E1oZRV2-000iMO-Om@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix huge_pages on Windows

Since Windows 10 1703, it is additionally necessary to pass a flag
called FILE_MAP_LARGE_PAGES to MapViewOfFile() to enable large pages at
map time. This flag is ignored on older versions of Windows, where
large pages should still be able to work properly without setting it.
Note that the flag would be set only for binaries that knew about it at
compile-time, which should be more or less all the Windows environments
these days.

Since 495ed0e, Windows 10 is the minimum version of Windows supported by
Postgres, making this change easy to reason about on HEAD. Per
discussion, no backpatch is done for the moment.

Reported-by: Okano Naoki
Author: Thomas Munro
Reviewed-by: Tom Lane, Michael Paquier, Julien Rouhaud
Discussion: https://postgr.es/m/17448-0a96583a67edb1f7@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/fdd8937c071e85e2b7606939fb28284f008e15d1

Modified Files
--------------
src/backend/port/win32_shmem.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Christoph Berg 2022-09-17 10:15:47 Re: pgsql: Fix createdb tests for C locale
Previous Message Peter Eisentraut 2022-09-17 06:20:47 pgsql: Message style improvements