<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Times New Roman; font-size: 12pt; color: #000000'><br>   Hi Vic,<br><br> Thanks for the update. We're glad to hear you sorted out the delays and that the cause was not VirtualBox :)<br><br> Also good to hear that there is a noticeable improvement with the latest code. We know it's faster (because guests perform better) but did not specifically measure the latency the way you did.<br><br><br>      Regards,<br>          Michal<br><br>----- Original Message -----<br>From: llyzs.vic@gmail.com<br>To: michal.necasek@oracle.com, vbox-dev@virtualbox.org<br>Sent: Wednesday, June 15, 2016 3:52:21 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna<br>Subject: Re: [vbox-dev] Driver ISR call delayed for device interrupts<br><br><div dir="ltr">Hi Michal & Ram,<div><br></div><div>Thanks for you prompt response, in fact it has been very helpful.</div><div><br></div><div>You were right that the suspicious delay at every 500ms was not in VirtualBox. I have identified that this was something else I was running on the host that caused it, so sorry for the confusion.</div><div><br></div><div>I am on stable 5.0 source. The way I measure the interrupt is to record the timestamp (QueryPerformanceCounter) when I call <span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;line-height:1.5">PDMDevHlpPCISetIrq to raise the interrupt level, and another timestamp when the driver sends another I/O to lower the interrupt in driver's ISR, then compare the two, so I think this should be precise. And I log the ones that only exceed 1ms.</span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;line-height:1.5"><br></span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;line-height:1.5">So after I fixed my own problem, the ISR delay is now mostly below 10ms, which is acceptable for me. I am certainly not expecting real-time response from a VM. :) For completeness, I also tried with the latest 5.1 source from SVN. And you were right again that there was noticeable improvement there. The delay is not 100% eliminated (of course) but it happens much less frequent and the delay tends to be much shorter, mostly 1-3ms.</span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;line-height:1.5"><br></span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;line-height:1.5">Thanks again.</span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;line-height:1.5"><br></span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;line-height:1.5">Vic</span></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jun 15, 2016 at 3:50 PM Michal Necasek <<a href="mailto:michal.necasek@oracle.com" target="_blank">michal.necasek@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
     Hi Vic,<br>
<br>
  It probably does not hurt to state that if you require real-time<br>
responsiveness, you should *not* be using a VM. There are no latency<br>
guarantees.<br>
<br>
  You forgot to mention the most relevant fact... which svn revision of<br>
the OSE source code are you actually using? In fact you expect any kind<br>
of technical support, you might as well start by providing a VBox.log<br>
because all the information is in there.<br>
<br>
  How exactly do you measure the delay? I assume it's from the device<br>
calling PDMDevHlpPCISetIrq to the guest accessing some device register<br>
in the ISR?<br>
<br>
  There might be problems specific to Windows 8.1(?) hosts. If you could<br>
repeat the test on a different host OS (ideally not Windows), that might<br>
provide some hints.<br>
<br>
  I don't know of anything in particular that would happen every 500 ms<br>
in VirtualBox, but it doesn't have to be the VM, it could be the host<br>
doing something as well.<br>
<br>
<br>
      Regards,<br>
        Michal<br>
<br>
<br>
On 6/15/2016 8:51 AM, llyzs wrote:<br>
> Hi Devs,<br>
><br>
> I have a virtual PCI device added on VirtualBox OSE and a driver which<br>
> sends I/O to do some stuff in the host and receive interrupts when the<br>
> work is done. The interrupts work most of the time, however there are<br>
> random delays between PDMDevHlpPCISetIrq is called and the driver ISR is<br>
> called. Most of the time there is no delay (<1ms) but periodically there<br>
> is a delay from 10+ms to even 60+ms. One more strange thing is that the<br>
> delay mostly happen at exactly every 500ms. So anyone can give me some<br>
> hint on what is causing the interrupt delay? What kind of job inside<br>
> VirtualBox that runs every 500ms that might be causing interrupt delay?<br>
><br>
> I am on Windows 8.1 x64 (both guest and host). Thanks in advanced.<br>
><br>
> Vic<br>
><br>
><br>
> _______________________________________________<br>
> vbox-dev mailing list<br>
> <a href="mailto:vbox-dev@virtualbox.org" target="_blank">vbox-dev@virtualbox.org</a><br>
> <a href="https://www.virtualbox.org/mailman/listinfo/vbox-dev" rel="noreferrer" target="_blank">https://www.virtualbox.org/mailman/listinfo/vbox-dev</a><br>
><br>
<br>
_______________________________________________<br>
vbox-dev mailing list<br>
<a href="mailto:vbox-dev@virtualbox.org" target="_blank">vbox-dev@virtualbox.org</a><br>
<a href="https://www.virtualbox.org/mailman/listinfo/vbox-dev" rel="noreferrer" target="_blank">https://www.virtualbox.org/mailman/listinfo/vbox-dev</a><br>
</blockquote></div>
</div></body></html>