Re: [PATCH] kvm-vmx: add module parameter to avoid trapping HLT instructions (v2)

Marcelo Tosatti
2010-12-03T18:25:17Z

On Fri, Dec 03, 2010 at 04:10:43PM -0200, Marcelo Tosatti wrote:
> On Fri, Dec 03, 2010 at 09:58:54AM -0800, Chris Wright wrote:
> > * Srivatsa Vaddagiri (vatsa@linux.vnet.ibm.com) wrote:
> > > On Fri, Dec 03, 2010 at 09:29:06AM -0800, Chris Wright wrote:
> > > > That's what Marcelo's suggestion does w/out a fill thread.
> > >
> > > There's one complication though even with that. How do we compute the
> > > real utilization of VM (given that it will appear to be burning 100% cycles)?
> > > We need to have scheduler discount the cycles burnt post halt-exit, so more
> > > stuff is needed than those simple 3-4 lines!
> >
> > Heh, was just about to say the same thing ;)
>
> Probably yes. The point is, you get the same effect as with the
> non-trapping hlt but without the complications on low-level VMX/SVM
> code.
>
> Even better if you can do it with fill thread idea.

Well, no. Better to consume hlt time but yield if need_resched or in
case of any event which breaks out of kvm_vcpu_block.