excuse me if I say something silly, as I am no expert in this matter... wouldn't it be _much_ easier to use a greater demultiplier for the timer interrupt, such that it will trigger more often than the default 18.2 Hz frequency?<br>
<br><div>thanks!</div><div>starrysky</div><div><br><div class="gmail_quote">On Wed, Oct 19, 2011 at 07:12, Michael Brown <span dir="ltr"><<a href="mailto:mbrown@fensystems.co.uk">mbrown@fensystems.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On Tuesday 18 Oct 2011 21:30:58 <a href="mailto:lustu.starrysky.cru@gmail.com">lustu.starrysky.cru@gmail.com</a> wrote:<br>
> I am running ipxe with UNDI driver under VmWare (don't know if the<br>
> driver matters at all).<br>
><br>
> I consistently see it taking 100% cpu under even when boot server is<br>
> offline.<br>
><br>
> Searching through the source code I see that cpu_nap() is being used<br>
> exactly for making sure ipxe doesn't take 100% of the guest cpu while<br>
> waiting, which would be too much of the host cpu.<br>
><br>
> Is there any place where ipxe is still doing busy waiting?<br>
<br>
</div></div>At present, iPXE will only call cpu_nap() when it knows that it is idle, such<br>
as when waiting for command line input. The reason for this is that cpu_nap()<br>
imposes a delay of up to 1/18s (one timer tick) before the next incoming<br>
network packet will be processed, since iPXE doesn't enable interrupts on the<br>
network card.<br>
<br>
The upshot of this is that if iPXE is non-idle (e.g. waiting for a DHCP<br>
response) then it will use 100% CPU.<br>
<br>
A proper solution to this would probably involve adding an activity counter<br>
(similar in principle to the device usage counter device_keep_count) which is<br>
incremented for each open TCP connection or other object that might rely upon<br>
timely receipt of network traffic. A "sleep" process could then call cpu_nap()<br>
only when the activity counter is at zero.<br>
<font color="#888888"><br>
Michael<br>
</font></blockquote></div><br></div>