diff options
author | Bryan Cantrill <bryan@joyent.com> | 2011-07-21 23:17:51 -0700 |
---|---|---|
committer | Bryan Cantrill <bryan@joyent.com> | 2011-07-21 23:17:51 -0700 |
commit | 8abc3de8938ef601c056107b771df44ef1a6fad1 (patch) | |
tree | 0cfd9c5bd5313152eec96a9f4518790a719a523a | |
parent | 1533058d07ed7bad09d996219a9db0686b0f0e4b (diff) | |
download | illumos-kvm-8abc3de8938ef601c056107b771df44ef1a6fad1.tar.gz |
HVM-501 hard-hang when starting many VMs concurrently
-rw-r--r-- | kvm.c | 23 |
1 files changed, 6 insertions, 17 deletions
@@ -517,22 +517,16 @@ vcpu_put(struct kvm_vcpu *vcpu) mutex_exit(&vcpu->mutex); } -static void -ack_flush(void *_completed) -{ -} - int make_all_cpus_request(struct kvm *kvm, unsigned int req) { int i; - cpuset_t set; processorid_t me, cpu; struct kvm_vcpu *vcpu; - CPUSET_ZERO(set); - mutex_enter(&kvm->requests_lock); + + kpreempt_disable(); me = curthread->t_cpu->cpu_id; for (i = 0; i < kvm->online_vcpus; i++) { vcpu = kvm->vcpus[i]; @@ -542,16 +536,11 @@ make_all_cpus_request(struct kvm *kvm, unsigned int req) continue; cpu = vcpu->cpu; if (cpu != -1 && cpu != me) - CPUSET_ADD(set, cpu); - } - if (CPUSET_ISNULL(set)) - kvm_xcall(KVM_CPUALL, ack_flush, NULL); - else { - kpreempt_disable(); - xc_sync((xc_arg_t) ack_flush, (xc_arg_t) NULL, - 0, CPUSET2BV(set), (xc_func_t) kvm_xcall_func); - kpreempt_enable(); + poke_cpu(cpu); } + + kpreempt_enable(); + mutex_exit(&kvm->requests_lock); return (1); |