Re: BUG #17448: In Windows 10, version 1703 and later, huge_pages doesn't work. - Mailing list pgsql-hackers

From Julien Rouhaud
Subject Re: BUG #17448: In Windows 10, version 1703 and later, huge_pages doesn't work.
Date
Msg-id Ymd7C+QineDpi7Eb@jrouhaud
Whole thread Raw
Responses Re: BUG #17448: In Windows 10, version 1703 and later, huge_pages doesn't work.  (Magnus Hagander <magnus@hagander.net>)
Re: BUG #17448: In Windows 10, version 1703 and later, huge_pages doesn't work.  (Michael Paquier <michael@paquier.xyz>)
Re: BUG #17448: In Windows 10, version 1703 and later, huge_pages doesn't work.  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Hi,

Please keep the list in copy, especially if that's about Windows specific as
I'm definitely not very knowledgeable about it.

On Fri, Apr 01, 2022 at 09:18:03AM +0000, Wilm Hoyer wrote:
> 
> If you don't wanna go the manifest way, maybe the RtlGetVersion function is the one you need:
> https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlgetversion?redirectedfrom=MSDN

Thanks for the info!  I tried to use the function but trying to include either
wdm.h or Ntddk.h errors out.  Unfortunately I don't know how to look for a file
in Windows so I don't even know if those files are present.

I searched a bit and apparently some people are using this function directly
opening some dll, which seems wrong.

> Another Idea on windows machines would be to use the commandline to execute
> ver in a separate Process and store the result in a file.

That also seems hackish, I don't think that we want to rely on something like
that.

> >> While winver.exe on the same vm says windows 11, version 21H2, build 22000.493.
> 
> > So, what GetVersionEx returns is actually "it depends", and this is documented:
> 
> >> With the release of Windows 8.1, the behavior of the GetVersionEx API 
> >> has changed in the value it will return for the operating system 
> >> version. The value returned by the GetVersionEx function now depends 
> >> on how the application is manifested.
> >>
> >> Applications not manifested for Windows 8.1 or Windows 10 will return 
> >> the Windows 8 OS version value (6.2). Once an application is 
> >> manifested for a given operating system version, GetVersionEx will 
> >> always return the version that the application is manifested for in 
> >> future releases. To manifest your applications for Windows 8.1 or 
> >> Windows 10, refer to Targeting your application for Windows.
> 
> The documentation is a bit unclear - with the correct functions you should get the:
> Minimum( actualOS-Version, Maximum(Manifested OS Versions))
> The Idea behind, as I understand it, is to better support virtualization and
> backward compatibility - you manifest only Windows 8.1 -> than you always get
> a System that behaves like Windows 8.1 in every aspect.  (Every Aspect not
> true in some corner cases due to security patches)

Well, it clearly does *NOT* behave as a Windows 8.1, even if for some reason
large pages relies on security patches.

Their API is entirely useless, so I'm still on the opinion that we should
unconditionally use the FILE_MAP_LARGE_PAGES flag if it's defined and call it a
day.



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: [Proposal] vacuumdb --schema only
Next
From: Michael Paquier
Date:
Subject: Re: pgsql: Add contrib/pg_walinspect.