Hacker News new | past | comments | ask | show | jobs | submit login

But what does a CPU running an idle virtual machine do?



By the way, FreeDOS and MS-DOS use 100% of the CPU when running on a VirtualBox virtual machine [1].

[1]: http://www.freedos.org/wiki/index.php/VirtualBox_-_Chapter_7


DOS-style operating systems were written at a time when halting the CPU to reduce power consumption was basically not a concern, so the "idle loop" is actually an infinite loop (TSRs often hooked into this loop to do "background processing", a rudimentary form of task switching.)

I seriously doubt that it is healthy for any computer to run for a longer time with 100% CPU usage.

Computers in the DOS and Win9x days would be at 100% CPU usage for basically as long as they were switched on; and a modern one should be absolutely fine running at 100% for an indefinite amount of time provided that things like the cooling system are in good working condition. The biggest difference between CPUs now and CPUs then is the difference in power consumption between idle/sleep and full power - e.g. a 66MHz 486 consumes <5W at full power (and not much difference when halted) vs. ~5W at idle and close to 100W for a recent Haswell i7.

If I have a DOS guest running for some time in VirtualBox, with full CPU usage, OS X eventually will pop up a nice half transparent window. It tells me that my computer needs now to be shut down and that I should push the power button long enough to do so. It's the Mac version of the BSOD.

That suggests insufficient cooling. If it's a system that's been in use for a while, it's probably time to clean out the heatsinks and fans. If a new system is overheating from 100% CPU usage, then I would consider it defective.


Yeah there's definitely something wrong with his hardware. If the CPU is overheating, even on my constantly thermally-constrained first-gen MacBook Pro Retina, it should just throttle down the CPU speed to something safe and painfully slow. He's definitely got some hardware fault if it's panicing (check the panic.log)


> That suggests insufficient cooling. If it's a system that's been in use for a while, it's probably time to clean out the heatsinks and fans. If a new system is overheating from 100% CPU usage, then I would consider it defective.

Yes, definitely. The thing to advise is: Clean the heatsinks and fans, and then run a performance test such as prime95 over night to see that the machine indeed can run at 100% usage for a prolonged time. Only then I'd trust a machine that was prone to crashing under load again for my work.


Which is why someone wrote DOSIDLE.

I'm only just starting to learn asm so I'm not entirely sure how it works, but the source is available at http://maribu.home.xs4all.nl/zeurkous/download/mirror/dosidl....


Not sure why this is being downvoted, it's actually a good question. If all of your VM's are idle, you would want your host CPU to idle as well, although my guess is this doesn't happen in things like Xen, VMWare, etc.


There has actually been problems with that, there was a bug with Citrix XenServer [0] where the CPU would, if left on idle for a long time, step down and turn off more or less all cores, which resulted in a locked up and unresponsive host. You can imagine what that did to the virtual machine supposedly running on that host.

[0] http://support.citrix.com/article/CTX127395


Off the top of my head: the VM executes either HLT or MWAIT, and those instructions are generally programmed to cause a VM exit, so the hypervisor can take action. The hypervisor will deschedule the VM and possibly go idle itself.

TBH, I have no idea how MONITOR works in a VM. It might be quite messy.

Edit: Here's a really nice explanation: http://www.contrib.andrew.cmu.edu/~somlo/OSXKVM/mwait.html


Does it reinitiate VM execution by waiting for the hypervisor to be scheduled again which schedules out to its constituent vms?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: