Re: BUG #17448: In Windows 10, version 1703 and later, huge_pages doesn't work.
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Julien Rouhaud <rjuju123@gmail.com>, okano.naoki@jp.fujitsu.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2022-03-26T11:33:48Z
Lists: pgsql-bugs, pgsql-hackers
On Sun, Mar 27, 2022 at 12:07:57AM +1300, Thomas Munro wrote: > Some question I have: is FILE_MAP_LARGE PAGES a macro? We claim to > support all those ancient zombie OSes like Windows 7, or maybe it's > even XP for 11, and this has to be back-patched to 11, so we might > need to make it conditional. But conditional on what? For example, > does something like the attached work (untested)? What happens if a < > 1703 kernel sees this flag, does it reject it or ignore it? Good question. I would choose a soft approach here and not insist if the flag was not known at compilation time, but we could also take a more aggressive approach and hardcode a value. Anyway, it seems to me that the correct solution here would be to compile the code with a PG_FILE_MAP_LARGE_PAGES that checks if the flag exists at compile time, and we would set it at run time if we know that we are on a version of Windows that supports it. IsWindowsVersionOrGreater() should be able to do the job. -- Michael
Commits
-
Fix huge_pages on Windows
- fdd8937c071e 16.0 landed