mirror of
https://github.com/reactos/reactos.git
synced 2025-01-05 22:12:46 +00:00
a4274ad548
What we have: - Maximum number of pagefiles: 16 - Minimum pagefile size: 256 pages (1 MB when page size = 4096 bytes) - Maximum pagefile size: * 32-bit platforms: (1024 * 1024 - 1) pages (~ 4095 MB) * x86 with PAE support: same size as for AMD x64 * x64 platform: (4 * 1024 * 1024 * 1024 - 1) pages (~ 16 TB) * IA64 platform: (8 * 1024 * 1024 * 1024 - 1) pages (~ 32 TB) Those are the values as supported and verified by the NT kernel. Now, user-mode programs (including SMSS.EXE) have different opinions on these, namely, they consider estimates directly in MB, respectively: 4095 MB, (16 * 1024 * 1024) MB, and (32 * 1024 * 1024) MB (verified on Win2k3 and Win7 32 and 64 bits). Also here, the minimum pagefile size is set to 2 MB. Starting Windows 8+ (and 10), those values change slightly, and are still not fully synchronized between NTOS:MM and SMSS. Finally, while (x86 PAE and) AMD64 and ARM64 seem to share the maximum pagefile size limit, 32-bit ARMv7 appears to use different limits than regular x86 (2 GB instead of 4). Please keep those values as they are for NT compatibility! See the following references: https://www.geoffchappell.com/studies/windows/km/ntoskrnl/api/mm/modwrite/create.htm https://techcommunity.microsoft.com/t5/ask-the-performance-team/what-is-the-page-file-for-anyway/ba-p/372608 + Manual extraction of the values from different NT 6.2,6.3,10 builds. [SMSS] Fill out in particular the x86-specific case for PAE. [NTOS:MM] Some cleanup in the NtCreatePagingFile() code, namely: - Clarify some comments; - Validate the lower and upper bounds of the Minimum and Maximum sizes (based on Windows behaviour as explained by Geoff + manual tests). - Open the pagefile in case-insensitive; - Simplify the loop that finds an existing matching pagefile; - Simplify some failure exit paths; - Add a "Missing validation steps TODO" comment block explaining the existing code-hole. |
||
---|---|---|
.. | ||
amd64 | ||
arm | ||
ARM3 | ||
i386 | ||
balance.c | ||
freelist.c | ||
marea.c | ||
mmfault.c | ||
mminit.c | ||
pagefile.c | ||
region.c | ||
rmap.c | ||
section.c | ||
shutdown.c |