<div dir="ltr"><div>Hi Nitin, <br></div><div><br></div><div>did you maybe miss read David and Stefans elaborations on this?</div><div><br></div><div><a href="https://mail.openjdk.org/pipermail/hotspot-runtime-dev/2023-October/065361.html" target="_blank">https://mail.openjdk.org/pipermail/hotspot-runtime-dev/2023-October/065361.html</a></div><div><br></div><div>Cheers, Thomas<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 16, 2023 at 5:35 PM Nitin Singh <<a href="mailto:singhnitin@microsoft.com" target="_blank">singhnitin@microsoft.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>





<div lang="EN-US">
<div>
<p><span style="font-size:12pt;font-family:"Aptos",sans-serif;color:black">Hello OpenJDK Community,<u></u><u></u></span></p>
<p style="margin-bottom:15pt"><span style="font-size:12pt;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.<u></u><u></u></span></p>
<p style="margin-bottom:15pt"><span style="font-size:12pt;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:10pt;color:black">os_windows.cpp</span></code><span style="font-size:12pt;font-family:"Aptos",sans-serif;color:black"><u></u><u></u></span></p>
<p style="margin-bottom:15pt"><span style="font-size:12pt;font-family:"Aptos",sans-serif;color:black"><a href="https://github.com/openjdk/jdk/blob/2e340e855b760e381793107f2a4d74095bd40199/src/hotspot/os/windows/os_windows.cpp#L3199." target="_blank">https://github.com/openjdk/jdk/blob/2e340e855b760e381793107f2a4d74095bd40199/src/hotspot/os/windows/os_windows.cpp#L3199.</a><u></u><u></u></span></p>
<p style="margin-bottom:15pt"><span style="font-size:12pt;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.<u></u><u></u></span></p>
<p style="margin-bottom:15pt"><span style="font-size:12pt;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.<u></u><u></u></span></p>
<p style="margin-bottom:15pt"><span style="font-size:12pt;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?<u></u><u></u></span></p>
<p style="margin-bottom:15pt"><span style="font-size:12pt;font-family:"Aptos",sans-serif;color:black">I'm currently working with the Microsoft JDK version
</span><code><span style="font-size:10pt;color:black">microsoft-jdk-17.0.8-windows-x64</span></code><span style="font-size:12pt;font-family:"Aptos",sans-serif;color:black">.<u></u><u></u></span></p>
<p style="margin-bottom:15pt"><span style="font-size:12pt;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.<u></u><u></u></span></p>
<p style="margin-bottom:15pt"><span style="font-size:12pt;font-family:"Aptos",sans-serif;color:black">Thanks,<u></u><u></u></span></p>
<p style="margin-bottom:15pt"><span style="font-size:12pt;font-family:"Aptos",sans-serif;color:black">Nitin Singh<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>

</div></blockquote></div>