“c2a6fbfb11c9b4c3877fc44e8d428e946392f030”上不存在“...doc/_sources/git@gitcode.net:Crayonxin2000/Paddle.git”
提交 5e0018b3 编写于 作者: D Davidlohr Bueso 提交者: Paolo Bonzini

kvm: Serialize wq active checks in kvm_vcpu_wake_up()

This is a generic call and can be suceptible to races
in reading the wq task_list while another task is adding
itself to the list. Add a full barrier by using the
swq_has_sleeper() helper.
Signed-off-by: NDavidlohr Bueso <dbueso@suse.de>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 a0cff57b
...@@ -2187,7 +2187,7 @@ bool kvm_vcpu_wake_up(struct kvm_vcpu *vcpu) ...@@ -2187,7 +2187,7 @@ bool kvm_vcpu_wake_up(struct kvm_vcpu *vcpu)
struct swait_queue_head *wqp; struct swait_queue_head *wqp;
wqp = kvm_arch_vcpu_wq(vcpu); wqp = kvm_arch_vcpu_wq(vcpu);
if (swait_active(wqp)) { if (swq_has_sleeper(wqp)) {
swake_up(wqp); swake_up(wqp);
++vcpu->stat.halt_wakeup; ++vcpu->stat.halt_wakeup;
return true; return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册