<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 30, 2017 at 8:20 PM, Eliot Miranda <span dir="ltr"><<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Alistair,<div class="gmail_extra"><br><div class="gmail_quote"><span class="gmail-">On Thu, Mar 30, 2017 at 9:32 AM, Alistair Grant <span dir="ltr"><<a href="mailto:akgrant0710@gmail.com" target="_blank">akgrant0710@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi Eliot,<br>
<span><br>
On 30 March 2017 at 18:15, Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>> wrote:<br>
><br>
> On Mar 30, 2017, at 2:58 AM, Pavel Krivanek <<a href="mailto:pavel.krivanek@gmail.com" target="_blank">pavel.krivanek@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Yes, the same priority. See:<br>
>><br>
>> The VM may have issues with clock jitter due to the heartbeat thread<br>
>> not running at elevated priority.<br>
><br>
><br>
> It better /not/ be.  This is wrong.  The heartbeat thread /must/ run at a<br>
> higher priority for the VM not to lock up when it becomes compute bound.  I<br>
> thought the resolution was that the VM /will/ try and raise the priority if<br>
> the heartbeat thread but will /not/ exit if it fails.  This is /very/<br>
> different from not trying to raise the priority at all.<br>
<br>
</span>As Esteban wrote, the vm is trying to raise the priority.  You can see<br>
the change at:<br>
<br>
<a href="https://github.com/pharo-project/pharo-vm/commit/32f321583c69ca27e61ffaff6decc2a3e4b6ca5e" rel="noreferrer" target="_blank">https://github.com/pharo-proje<wbr>ct/pharo-vm/commit/32f321583c6<wbr>9ca27e61ffaff6decc2a3e4b6ca5e</a><br>
<br>
I'd like to just make sure I understand your comment correctly:<br>
<br>
Are you saying that the VM will lock up if it gets in to, e.g., an<br>
endless loop, so that Ctrl-. fails to interrupt.  Or is it more<br>
serious than that?  Can the VM become locked up for just a long<br>
running process (I guess it will be locked while the process is<br>
running, but will eventually go back to normal once the process<br>
completes)?<br></blockquote><div><br></div></span><div>The issue is that delays are recognized by periodically checking the time against the next delay expiry.  It is the heartbeat thread that causes JITed Smalltalk code to break out of its execution to check for events, including the next delay expiry.  So if the heartbeat is at the same priority as the JITed Smalltalk code, and the Smalltalk code is in tight enough a loop (one that does not provoke a GC, does not do any process switches) the heartbeat thread will not run and the delay expiry will never be tested for.</div></div></div></div></blockquote><div><br></div><div>Something like the following should run forever if the heartbeat has the same priority as the VM thread (and should be tried in a headless configuration too):</div><div><br></div><div>[| infiniteLoop |</div><div>infiniteLoop := [| sum | sum := 0. [sum < 10] whileTrue: [sum := sum + (sum even ifTrue: [1] ifFalse: [-1])]] newProcess.</div><div>infiniteLoop resume.</div><div>Processor activeProcess priority: Processor activePriority + 1.</div><div>(Delay forSeconds: 1) wait.</div><div>infiniteLoop terminate.</div><div>Processor activeProcess priority: Processor activePriority - 1] timeToRun 1001</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
Also, a change was made to the travis test setup in:<br>
<br>
<a href="https://github.com/pharo-project/pharo-vm/commit/5418a415e9297f601f6d57ee732fd7fd942da08c" rel="noreferrer" target="_blank">https://github.com/pharo-proje<wbr>ct/pharo-vm/commit/5418a415e92<wbr>97f601f6d57ee732fd7fd942da08c</a><br>
<br>
The comment is: "No need to raise rtprio limit anymore"<br>
<br>
>From your comments above, this doesn't seem accurate.<br></blockquote><div><br></div></span><div>Right.  What seems to occur is that certain linux distress don't require a conf file to allow raising the priority of a thread.  Remember that rtprio is not the issue.  We only require that the heartbeat thread has higher priority than the VM thread.</div><span class="gmail-"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
I'm in the middle of adding some details to the text that is printed<br>
out by the threaded heartbeat vm, and from what you're saying, maybe<br>
we should add some more warnings.<br></blockquote><div><br></div></span><div>The VM should (& I believe already does) print an error if the attempt to raise the heartbeat thread priority fails.  My underatanding is that the positive change is simply not to exit if the attempt fails.</div><span class="gmail-"><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<span><br>
<br>
> The resolution I thought we had reached means that if correctly installed<br>
> the VM can work correctly, and will continue to work correctly if and when<br>
> linux removes the annoyance of the conf files.  The resolution you describe<br>
> Pavel (I hope inaccurately) means the threaded heartbeat VM will never work<br>
> correctly.<br>
<br>
</span>Thanks,<br>
Alistair<br></blockquote></span></div><br><div class="gmail-m_-2591364219664606994gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>