Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1587898 > unrolled thread

[PATCH v2 5/5] KVM: optimize kvm_make_all_cpus_request

Started byRadim Krčmář <rkrcmar@redhat.com>
First post2017-02-24 21:00 +0100
Last post2017-02-24 21:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 5/5] KVM: optimize kvm_make_all_cpus_request Radim Krčmář <rkrcmar@redhat.com> - 2017-02-24 21:00 +0100

#1587898 — [PATCH v2 5/5] KVM: optimize kvm_make_all_cpus_request

FromRadim Krčmář <rkrcmar@redhat.com>
Date2017-02-24 21:00 +0100
Subject[PATCH v2 5/5] KVM: optimize kvm_make_all_cpus_request
Message-ID<teuc2-4Ze-7@gated-at.bofh.it>
Use __kvm_request_set to avoid repeated use of wmb().
kvm_make_all_cpus_request is also a candidate for renaming.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
---
 virt/kvm/kvm_main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 0ee1df3bfcb8..eaab32349664 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -177,8 +177,12 @@ bool kvm_make_all_cpus_request(struct kvm *kvm, unsigned int req)
 	zalloc_cpumask_var(&cpus, GFP_ATOMIC);
 
 	me = get_cpu();
+
+	/* Paired with the smp_mb__after_atomic in kvm_request_test_and_clear. */
+	smp_wmb();
+
 	kvm_for_each_vcpu(i, vcpu, kvm) {
-		kvm_request_set(req, vcpu);
+		__kvm_request_set(req, vcpu);
 		cpu = vcpu->cpu;
 
 		/* Set ->requests bit before we read ->mode. */
-- 
2.11.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web