public inbox for [email protected]  
help / color / mirror / Atom feed
From: Julien Rouhaud <[email protected]>
To: Michael Paquier <[email protected]>
Cc: Thomas Munro <[email protected]>
Cc: [email protected]
Cc: PostgreSQL mailing lists <[email protected]>
Subject: Re: BUG #17448: In Windows 10, version 1703 and later, huge_pages doesn't work.
Date: Thu, 31 Mar 2022 18:46:59 +0800
Message-ID: <20220331104659.ol6pqe7s3tpkymuk@jrouhaud> (raw)
In-Reply-To: <20220331080055.hjrrsrd4lxwlt7f5@jrouhaud>
References: <[email protected]>
	<[email protected]>
	<20220326082408.moh55zuecxjmewnm@jrouhaud>
	<CA+hUKGLwOSf-QwVtCcKx9xvugN2BSzEBBeD5DNyTXgcSRp5sTw@mail.gmail.com>
	<YkQMyhsP7xgLDDT/@paquier.xyz>
	<20220331045908.bm5edcacvymgwwv2@jrouhaud>
	<[email protected]>
	<20220331080055.hjrrsrd4lxwlt7f5@jrouhaud>

On Thu, Mar 31, 2022 at 04:00:55PM +0800, Julien Rouhaud wrote:
> > Okano-san has mentioned VMMap upthread:
> > https://docs.microsoft.com/en-us/sysinternals/downloads/vmmap
> 
> Yes, I totally missed that.  Thomas Munro also mentioned it off-list, and
> also found some reference [1] indicating that large pages should show up as
> "Locked WS".  I tested with and without the patch and in both case I don't see
> any "Locked WS" usage.  I also get the same Page Table size, which seems
> consistent with large pages not being used.  Now, this is a vm running with
> virtualbox and we're not entirely sure that huge pages can be allocated with
> it.  I wish I could test on my windows 10 machine as it's not virtualized, but
> I can't give the required privileges.
> 
> [1] https://aloiskraus.wordpress.com/2016/10/03/windows-10-memory-compression-and-more/

So, after more digging it turns out that the patch is supposed to work.  If I
force using the PG_FILE_MAP_LARGE_PAGES, postgres starts and I do see "Locked
WS" usage with VMMap, with a size in the order of magnitude of my
shared_buffers.

What is apparently not working on my VM is IsWindowsVersionOrGreater(10, 0,
1703).  I added some debug around to check what GetVersionEx() [2] is saying,
and I get:

dwMajorVersion == 6
dwMinorVersion == 2
dwBuildNumber == 9200

While winver.exe on the same vm says windows 11, version 21H2, build 22000.493.

I'm therefore extremely confused.  The documentation of
IsWindowsVersionOrGreater() at [3] is also highly confusing:

> TRUE if the specified version matches, or is greater than, the version of the
> current Windows OS; otherwise, FALSE.

Isn't that supposed to be the opposite?

[2] https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getversionexa
https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-osversioninfoexa

[3] https://docs.microsoft.com/en-us/windows/win32/api/versionhelpers/nf-versionhelpers-iswindowsversion...





view thread (22+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: BUG #17448: In Windows 10, version 1703 and later, huge_pages doesn't work.
  In-Reply-To: <20220331104659.ol6pqe7s3tpkymuk@jrouhaud>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox