diff mbox

[RFC,2/2] kvm: Iterate over only vcpus that are preempted

Message ID 20130304180227.31281.96284.sendpatchset@codeblue.in.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Raghavendra K T March 4, 2013, 6:02 p.m. UTC
From: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>

This helps in filtering out the eligible candidates further and 
thus potentially helps in quickly allowing preempted lockholders to run.
Note that if a vcpu was spinning during preemption we filter them
by checking whether they are preempted due to pause loop exit.

Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
---
 virt/kvm/kvm_main.c |    2 ++
 1 file changed, 2 insertions(+)


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Chegu Vinod March 5, 2013, 3:20 p.m. UTC | #1
On 3/4/2013 10:02 AM, Raghavendra K T wrote:
> From: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
>
> This helps in filtering out the eligible candidates further and
> thus potentially helps in quickly allowing preempted lockholders to run.
> Note that if a vcpu was spinning during preemption we filter them
> by checking whether they are preempted due to pause loop exit.
>
> Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
> ---
>   virt/kvm/kvm_main.c |    2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 83a804c..60114e1 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -1790,6 +1790,8 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me)
>   				continue;
>   			} else if (pass && i > last_boosted_vcpu)
>   				break;
> +			if (!ACCESS_ONCE(vcpu->preempted))
> +				continue;
>   			if (vcpu == me)
>   				continue;
>   			if (waitqueue_active(&vcpu->wq))
>
> .
>
Reviewed-by: Chegu Vinod <chegu_vinod@hp.com>
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 83a804c..60114e1 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1790,6 +1790,8 @@  void kvm_vcpu_on_spin(struct kvm_vcpu *me)
 				continue;
 			} else if (pass && i > last_boosted_vcpu)
 				break;
+			if (!ACCESS_ONCE(vcpu->preempted))
+				continue;
 			if (vcpu == me)
 				continue;
 			if (waitqueue_active(&vcpu->wq))