Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125296
b: refs/heads/master
c: 6ef7a1b
h: refs/heads/master
v: v3
  • Loading branch information
Rusty Russell authored and Avi Kivity committed Dec 31, 2008
1 parent ef99836 commit d19032b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 498468961ed6f62a306eb90c49125776c526fa40
refs/heads/master: 6ef7a1bc45f80fe0a263119d404688c596ea5031
23 changes: 14 additions & 9 deletions trunk/virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,27 +555,32 @@ static void ack_flush(void *_completed)
static bool make_all_cpus_request(struct kvm *kvm, unsigned int req)
{
int i, cpu, me;
cpumask_t cpus;
bool called = false;
cpumask_var_t cpus;
bool called = true;
struct kvm_vcpu *vcpu;

if (alloc_cpumask_var(&cpus, GFP_ATOMIC))
cpumask_clear(cpus);

me = get_cpu();
cpus_clear(cpus);
for (i = 0; i < KVM_MAX_VCPUS; ++i) {
vcpu = kvm->vcpus[i];
if (!vcpu)
continue;
if (test_and_set_bit(req, &vcpu->requests))
continue;
cpu = vcpu->cpu;
if (cpu != -1 && cpu != me)
cpu_set(cpu, cpus);
}
if (!cpus_empty(cpus)) {
smp_call_function_mask(cpus, ack_flush, NULL, 1);
called = true;
if (cpus != NULL && cpu != -1 && cpu != me)
cpumask_set_cpu(cpu, cpus);
}
if (unlikely(cpus == NULL))
smp_call_function_many(cpu_online_mask, ack_flush, NULL, 1);
else if (!cpumask_empty(cpus))
smp_call_function_many(cpus, ack_flush, NULL, 1);
else
called = false;
put_cpu();
free_cpumask_var(cpus);
return called;
}

Expand Down

0 comments on commit d19032b

Please sign in to comment.