<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=utf-8">
<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";
mso-fareast-language:#2000;}
span.scope-head
{mso-style-name:scope-head;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:914976199;
mso-list-type:hybrid;
mso-list-template-ids:-1885071302 536870927 536870937 536870939 536870927 536870937 536870939 536870927 536870937 536870939;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></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-DE" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="DE">Hi guys,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The </span><a href="https://github.com/openjdk/jdk/blob/master/test/jdk/java/net/httpclient/http2/ContinuationFrameTest.java">ContinuationFrameTest.java</a>
<span lang="EN-US">on AIX fails to end within the gracedelay period.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The gracedelay period function in<b> </b>
</span><a href="https://github.com/openjdk/jdk/blob/master/test/jdk/java/net/httpclient/ReferenceTracker.java#L270">ReferenceTracker.java
</a><span lang="EN-US">effectively does the following:<b><o:p></o:p></b></span></p>
<p class="MsoNormal"><span class="scope-head"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:#2000">for (i = 0; i < 50; i++) {<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="scope-head"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:#2000"> if (!TRACKERS.stream().anyMatch(hasOutstanding))
<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="scope-head"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:#2000"> break;<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="scope-head"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:#2000"> System.gc();<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="scope-head"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:#2000"> Thread.sleep(10);<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="scope-head"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:#2000">}<o:p></o:p></span></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">During this grace period there are at least 3 thread categories fighting for the
</span><span class="scope-head"><span style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:#2000">threads_lock</span></span><span lang="EN-US"> mutex.<o:p></o:p></span></p>
<pre style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2;background:white"><![if !supportLists]><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><span style="mso-list:Ignore">1.<span style="font:7.0pt "Times New Roman""> </span></span></span><![endif]><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US">The</span><span lang="EN-US" style="color:black"> <span class="scope-head"><a href="http://ccwdfgl9733.glds.c.eu-de-1.cloud.sap:8080/source/s?defs=SafepointSynchronize&project=openjdk-jdk"><span style="color:black;text-decoration:none">SafepointSynchronize</span></a>::<a href="http://ccwdfgl9733.glds.c.eu-de-1.cloud.sap:8080/source/s?refs=begin&project=openjdk-jdk"><span style="color:black;text-decoration:none">begin</span></a>() </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US">locks t</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US">he</span><span class="scope-head"><span style="color:black"> </span></span><span class="scope-head"><span lang="EN-US" style="color:black">threads_lock </span></span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US">mutex for the gc</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US">. It holds the mutex for about 300ms.</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p></o:p></span></pre>
<pre style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2;background:white"><![if !supportLists]><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><span style="mso-list:Ignore">2.<span style="font:7.0pt "Times New Roman""> </span></span></span><![endif]><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US">The </span><span class="scope-head"><span lang="EN-US" style="color:black">wait_until_not_protected()</span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US"> function, which is called a dozen times during one loop iteration. It holds the mutex for about 0.4ms.</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p></o:p></span></pre>
<pre style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2;background:white"><![if !supportLists]><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><span style="mso-list:Ignore">3.<span style="font:7.0pt "Times New Roman""> </span></span></span><![endif]><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US">And the </span><span class="scope-head"><span lang="EN-US" style="color:black">SelectorManager </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US">threads which need the mutex one time to complete their shutdown. They need the mutex for about 0.5ms.</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p></o:p></span></pre>
<pre style="background:white"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></pre>
<pre style="background:white"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US">The threads of all three categories are running with <u>identical</u> native thread priority .</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p></o:p></span></pre>
<pre style="background:white"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></pre>
<pre style="background:white"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US">On the various Linux derivates(x86 and ppc64) you can see, that the </span><span class="scope-head"><span lang="EN-US" style="color:black">SelectorManager</span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US"> threads are finding slots between the other mutex consumers, so that all threads are shutdown within about 7 loop iterations.</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p></o:p></span></pre>
<pre style="background:white"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US">On AIX the </span><span class="scope-head"><span lang="EN-US" style="color:black">SelectorManager</span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US"> threads can’t make it or less often. So, some of them are still alive after the complete grace period, although they were queued up even before the grace period. This means in total 50 iterations where their requests were ignored and all later coming requests from 1.+2. were satisfied.</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p></o:p></span></pre>
<pre style="background:white"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></pre>
<pre style="background:white"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US">So, how are the thread priorities handled in hotspot. Why are the AIX </span><span class="scope-head"><span lang="EN-US" style="color:black">SelectorManager</span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US"> threads discriminated.<o:p></o:p></span></pre>
<pre style="background:white"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US">Can you please help me with an idea.</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p></o:p></span></pre>
<pre style="background:white"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></pre>
<pre style="background:white"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US">Greetings</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p></o:p></span></pre>
<pre style="background:white"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black;mso-fareast-language:EN-US">Joachim</span><span lang="EN-US"><o:p></o:p></span></pre>
<p class="MsoNormal"><span lang="DE"><o:p> </o:p></span></p>
</div>
</body>
</html>