logo       

Re: [PATCH 9/9] KVM: Adds support for halting in the kernel: msg#00555

emulators.kvm.devel

Subject: Re: [PATCH 9/9] KVM: Adds support for halting in the kernel

Gregory Haskins wrote:
> Halting in userspace requires a relatively cumbersome mechanism to signal the
> halted VCPU. Implementing halt in kernel should be relatively straight
> forward and it eliminates the need for the signaling
>
>

Merging this one in, found some nits:

> +/*
> * This function is invoked whenever we want to interrupt a vcpu that is
> * currently executing in guest-mode. It currently is a no-op because
> * the simple delivery of the IPI to execute this function accomplishes our
> @@ -2481,6 +2556,16 @@ static void kvm_vcpu_intr(struct kvm_irqsink *this,
> BUG_ON(direct_ipi == smp_processor_id());
> ++vcpu->stat.guest_preempt;
> }
> +
> + /*
> + * If the CPU is halted it will be waiting for a wake-up
> + */
> + if (waitqueue_active(&vcpu->irq.wq)) {
>

Why do the check? The only reason I can see is to keep the stats
correct. Otherwise we can do the body of the if unconditionally.

> + wake_up_interruptible_sync(&vcpu->irq.wq);
> + set_tsk_need_resched(current);
>

This is unneeded? I'd expect wake_up_interruptible_sync() to take care
of any rescheduling needed.

> + ++vcpu->stat.halt_wakeup;
> + }
> +
>


--
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise