From: Julien Rouhaud <rjuju123@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: okano.naoki@jp.fujitsu.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #17448: In Windows 10, version 1703 and later, huge_pages doesn't work.
Date: Thu, 31 Mar 2022 19:03:09 +0800
Message-ID: <20220331110309.ws25d6dl5yyzprye@jrouhaud> (raw)
In-Reply-To: <20220331104659.ol6pqe7s3tpkymuk@jrouhaud>
References: <17448-0a96583a67edb1f7@postgresql.org>
<Yj6oxYsBE5LXA8ZP@paquier.xyz>
<20220326082408.moh55zuecxjmewnm@jrouhaud>
<CA+hUKGLwOSf-QwVtCcKx9xvugN2BSzEBBeD5DNyTXgcSRp5sTw@mail.gmail.com>
<YkQMyhsP7xgLDDT/@paquier.xyz>
<20220331045908.bm5edcacvymgwwv2@jrouhaud>
<YkVbbZBiC4yxXPuc@paquier.xyz>
<20220331080055.hjrrsrd4lxwlt7f5@jrouhaud>
<20220331104659.ol6pqe7s3tpkymuk@jrouhaud>
On Thu, Mar 31, 2022 at 06:46:59PM +0800, Julien Rouhaud wrote:
> 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.
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.
There's no such indication on IsWindowsVersionOrGreater(), but after seeing
various comments on forums from angry people, it may be a hint that it behaves
similarly. I'm not sure what to do at this point, maybe just always use the
flag (the PG_ version which may be 0), hoping that hopefully windows won't
define it if it can't handle it?
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: rjuju123@gmail.com, michael@paquier.xyz, thomas.munro@gmail.com
Subject: Re: BUG #17448: In Windows 10, version 1703 and later, huge_pages doesn't work.
In-Reply-To: <20220331110309.ws25d6dl5yyzprye@jrouhaud>
References: <17448-0a96583a67edb1f7@postgresql.org> <Yj6oxYsBE5LXA8ZP@paquier.xyz> <20220326082408.moh55zuecxjmewnm@jrouhaud> <CA+hUKGLwOSf-QwVtCcKx9xvugN2BSzEBBeD5DNyTXgcSRp5sTw@mail.gmail.com> <YkQMyhsP7xgLDDT/@paquier.xyz> <20220331045908.bm5edcacvymgwwv2@jrouhaud> <YkVbbZBiC4yxXPuc@paquier.xyz> <20220331080055.hjrrsrd4lxwlt7f5@jrouhaud> <20220331104659.ol6pqe7s3tpkymuk@jrouhaud> <20220331110309.ws25d6dl5yyzprye@jrouhaud>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox