mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
KVM: avoid unnecessary synchronize_rcu
We dont have to wait for a grace period if there is no oldpid that
we are going to free. putpid also checks for NULL, so this patch
only fences synchronize_rcu.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 7103f60de8)
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
This commit is contained in:
committed by
Christoffer Dall
parent
57f984d2c6
commit
7fdbe25673
@@ -129,7 +129,8 @@ int vcpu_load(struct kvm_vcpu *vcpu)
|
||||
struct pid *oldpid = vcpu->pid;
|
||||
struct pid *newpid = get_task_pid(current, PIDTYPE_PID);
|
||||
rcu_assign_pointer(vcpu->pid, newpid);
|
||||
synchronize_rcu();
|
||||
if (oldpid)
|
||||
synchronize_rcu();
|
||||
put_pid(oldpid);
|
||||
}
|
||||
cpu = get_cpu();
|
||||
|
||||
Reference in New Issue
Block a user