<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr">Will do and I’ll report back. </div><div dir="ltr"><br><blockquote type="cite">On Jun 25, 2024, at 3:14 AM, Alan Bateman <Alan.Bateman@oracle.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
On 24/06/2024 23:03, Robert Engels wrote:<br>
<blockquote type="cite" cite="mid:777E865C-A9CA-46C8-B057-EB9D9448E4DE@me.com">
<div style="word-wrap:break-word; line-break:after-white-space">
<div class="" style="margin:0px; font-stretch:normal; font-size:18px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
</div>
<div class="" style="margin:0px; font-stretch:normal; font-size:18px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<br class="">
</div>
<div class="" style="margin:0px; font-stretch:normal; font-size:18px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span class="" style="font-family:Helvetica; font-size:16px">The
VT latency is a couple of orders of magnitude higher than
the platform latency.</span></div>
<div class="" style="margin:0px; font-stretch:normal; font-size:18px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span class="" style="font-family:Helvetica; font-size:16px"><br class="">
</span></div>
<div class="" style="margin:0px; font-stretch:normal; font-size:18px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span class="" style="font-family:Helvetica; font-size:16px">I
suspect that what is happening is that the virtual threads
are parking waiting for work too soon - or that the read
& writes are always causing a context switch -
regardless of if the call is very short (room in the kernel
socket buffers).</span></div>
<div class="" style="margin:0px; font-stretch:normal; font-size:18px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span class="" style="font-family:Helvetica; font-size:16px"><br class="">
</span></div>
<div class="" style="margin:0px; font-stretch:normal; line-height:normal; color:rgb(0,0,0)">
Can you suggest any remedies? It feels like the scheduler
needs some heuristics on average call time to determine and a
spin loop to avoid this sort of thing.</div>
<br>
</div>
</blockquote>
There may be a combination of things here. From the stack traces,
this looks like JDK 21 + macOS. There has been significant changes
to both the scheduler (ForkJoinPool) and the I/O poller mechanism
since then. Would you have time to out the latest EA build [1] to
see if you get similar latency? It would be interesting to see data
with -Djdk.pollerMode=1 and 2 (the default on macOS is "a"). Also
would be useful to see `jcmd <pid> Thread.vthread_summary`
output while the benchmark is running as that will reveal more about
the scheduler and how many virtual threads are blocked on socket
I/O.<br>
<br>
[1] <a class="moz-txt-link-freetext" href="https://jdk.java.net/loom/">https://jdk.java.net/loom/</a><br>
</div></blockquote></body></html>