Re: [PATCH] KVM: Get rid of KVM_REQ_KICK

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/04/2010 07:42 PM, Avi Kivity wrote:
@@ -5470,7 +5473,7 @@ void kvm_vcpu_kick(struct kvm_vcpu *vcpu)

      me = get_cpu();
      if (cpu != me&&  (unsigned)cpu<  nr_cpu_ids&&  cpu_online(cpu))
-        if (!test_and_set_bit(KVM_REQ_KICK,&vcpu->requests))
+        if (atomic_xchg(&vcpu->guest_mode, 0))
              smp_send_reschedule(cpu);
      put_cpu();


The atomic_xchg() does the trick.


btw, things like this should go into locking.txt.  It's definitely tricky.

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

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

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux