<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Aptos;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Aptos",sans-serif;
mso-ligatures:standardcontextual;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#467886;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Aptos",sans-serif;
color:windowtext;}
p.elementtoproof, li.elementtoproof, div.elementtoproof
{mso-style-name:elementtoproof;
margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:11.0pt;
font-family:"Aptos",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<p class="elementtoproof"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">Hello OpenJDK Community,<o:p></o:p></span></p>
<p style="margin-bottom:15.0pt"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">I've been immersing myself in understanding large pages within OpenJDK, especially for the Windows OS. Here's an observation I'd like to share and seek
feedback on.<o:p></o:p></span></p>
<p class="elementtoproof" style="margin-bottom:15.0pt"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">It appears that on Windows Server 2022 Datacenter (OS Version: 10.0.20348), when employing AMD or Intel processors, there's an implicit
restriction that limits the use of large page sizes to 4MB. This constraint seems to originate from line 3199 in
</span><code><span style="font-size:10.0pt;color:black">os_windows.cpp</span></code><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black"><o:p></o:p></span></p>
<p class="elementtoproof" style="margin-bottom:15.0pt"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black"><a href="https://github.com/openjdk/jdk/blob/2e340e855b760e381793107f2a4d74095bd40199/src/hotspot/os/windows/os_windows.cpp#L3199.">https://github.com/openjdk/jdk/blob/2e340e855b760e381793107f2a4d74095bd40199/src/hotspot/os/windows/os_windows.cpp#L3199.</a><o:p></o:p></span></p>
<p style="margin-bottom:15.0pt"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">To probe this further, I tweaked the code to see what would happen without this restriction. The results were enlightening. I was able to successfully
use an 8MB large page size, and my subsequent benchmarks post this change have been quite positive.<o:p></o:p></span></p>
<p style="margin-bottom:15.0pt"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">What heightens my curiosity is the knowledge that these processors support up to 1G of large pages (HugeTLB pages). Given the widespread support for these
processors by various cloud providers, it does feel like we're missing out on potential optimizations for HotSpot running on Windows.<o:p></o:p></span></p>
<p style="margin-bottom:15.0pt"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">Before delving deeper, I'd love to get some historical context. Can anyone share insights about why this 4MB limit was imposed in the first place? Were
there specific technical challenges or concerns that led to this decision?<o:p></o:p></span></p>
<p style="margin-bottom:15.0pt"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">I'm currently working with the Microsoft JDK version
</span><code><span style="font-size:10.0pt;color:black">microsoft-jdk-17.0.8-windows-x64</span></code><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">.<o:p></o:p></span></p>
<p class="elementtoproof" style="margin-bottom:15.0pt"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">Thank you for shedding light on this matter. I deeply appreciate your guidance as I tread these waters.<o:p></o:p></span></p>
<p class="elementtoproof" style="margin-bottom:15.0pt"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">Thanks,<o:p></o:p></span></p>
<p class="elementtoproof" style="margin-bottom:15.0pt"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">Nitin Singh<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>