Skip to content

Commit

Permalink
KVM: Drop obsolete cpu_get/put in make_all_cpus_request
Browse files Browse the repository at this point in the history
spin_lock disables preemption, so we can simply read the current cpu.

Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>
  • Loading branch information
jan-kiszka authored and avikivity committed Sep 10, 2009
1 parent 84fde24 commit e601e3b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,8 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req)
if (alloc_cpumask_var(&cpus, GFP_ATOMIC))
cpumask_clear(cpus);

me = get_cpu();
spin_lock(&kvm->requests_lock);
me = smp_processor_id();
kvm_for_each_vcpu(i, vcpu, kvm) {
if (test_and_set_bit(req, &vcpu->requests))
continue;
Expand All @@ -757,7 +757,6 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req)
else
called = false;
spin_unlock(&kvm->requests_lock);
put_cpu();
free_cpumask_var(cpus);
return called;
}
Expand Down

0 comments on commit e601e3b

Please sign in to comment.