Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1581395
| From | Christian Borntraeger <borntraeger@de.ibm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] KVM: race-free exit from KVM_RUN without POSIX signals |
| Date | 2017-02-15 16:30 +0100 |
| Message-ID | <tb9GN-1II-1@gated-at.bofh.it> (permalink) |
| References | <tb946-1ef-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 02/15/2017 03:43 PM, Paolo Bonzini wrote: > The purpose of the KVM_SET_SIGNAL_MASK API is to let userspace "kick" > a VCPU out of KVM_RUN through a POSIX signal. A signal is attached > to a dummy signal handler; by blocking the signal outside KVM_RUN and > unblocking it inside, this possible race is closed: > > VCPU thread service thread > -------------------------------------------------------------- > check flag > set flag > raise signal > (signal handler does nothing) > KVM_RUN > > However, one issue with KVM_SET_SIGNAL_MASK is that it has to take > tsk->sighand->siglock on every KVM_RUN. This lock is often on a > remote NUMA node, because it is on the node of a thread's creator. > Taking this lock can be very expensive if there are many userspace > exits (as is the case for SMP Windows VMs without Hyper-V reference > time counter). > > As an alternative, we can put the flag directly in kvm_run so that > KVM can see it: > > VCPU thread service thread > -------------------------------------------------------------- > raise signal > signal handler > set run->immediate_exit > KVM_RUN > check run->immediate_exit > > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Generic parts, the concept and the s390 parts looks good. (not tested yet, though)
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] KVM: race-free exit from KVM_RUN without POSIX signals Paolo Bonzini <pbonzini@redhat.com> - 2017-02-15 15:50 +0100
Re: [PATCH] KVM: race-free exit from KVM_RUN without POSIX signals Christian Borntraeger <borntraeger@de.ibm.com> - 2017-02-15 16:30 +0100
Re: [PATCH] KVM: race-free exit from KVM_RUN without POSIX signals Paolo Bonzini <pbonzini@redhat.com> - 2017-02-15 17:00 +0100
Re: [PATCH] KVM: race-free exit from KVM_RUN without POSIX signals Radim Krčmář <rkrcmar@redhat.com> - 2017-02-16 17:30 +0100
Re: [PATCH] KVM: race-free exit from KVM_RUN without POSIX signals David Hildenbrand <david@redhat.com> - 2017-02-16 20:30 +0100
Re: [PATCH] KVM: race-free exit from KVM_RUN without POSIX signals Paolo Bonzini <pbonzini@redhat.com> - 2017-02-17 10:50 +0100
csiph-web