Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1209459

Re: [PATCH v2 4/5] KVM: add KVM_USER_EXIT vcpu ioctl for userspace exit

From Paolo Bonzini <pbonzini@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 4/5] KVM: add KVM_USER_EXIT vcpu ioctl for userspace exit
Date 2015-08-18 22:00 +0200
Message-ID <pYVd9-7KG-37@gated-at.bofh.it> (permalink)
References <pU9Tr-6QK-1@gated-at.bofh.it> <pU9Ts-6QK-19@gated-at.bofh.it> <pYcJ3-2o7-1@gated-at.bofh.it> <pYsuu-8oB-5@gated-at.bofh.it> <pYTXI-61Z-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 18/08/2015 11:30, Avi Kivity wrote:
>> KVM_USER_EXIT in practice should be so rare (at least with in-kernel
>> LAPIC) that I don't think this matters.  KVM_USER_EXIT is relatively
>> uninteresting, it only exists to provide an alternative to signals that
>> doesn't require expensive atomics on each and every KVM_RUN. :(
> 
> Ah, so the idea is to remove the cost of changing the signal mask?

Yes, it's explained in the cover letter.

> Yes, although it looks like a thread-local operation, it takes a
> process-wide lock.

IIRC the lock was only task-wide and uncontended.  Problem is, it's on
the node that created the thread rather than the node that is running
it, and inter-node atomics are really, really slow.

For guests spanning >1 host NUMA nodes it's not really practical to
ensure that the thread is created on the right node.  Even for guests
that fit into 1 host node, if you rely on AutoNUMA the VCPUs are created
too early for AutoNUMA to have any effect.  And newer machines have
frighteningly small nodes (two nodes per socket, so it's something like
7 pCPUs if you don't have hyper-threading enabled).  True, the NUMA
penalty within the same socket is not huge, but it still costs a few
thousand clock cycles on vmexit.flat and this feature sweeps it away
completely.

> I expect most user wakeups are via irqfd, so indeed the performance of
> KVM_USER_EXIT is uninteresting.

Yup, either irqfd or KVM_SET_SIGNAL_MSI.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/5] KVM: optimize userspace exits with a new ioctl Radim Krčmář <rkrcmar@redhat.com> - 2015-08-05 18:40 +0200
  [PATCH v2 1/5] KVM: add kvm_has_request wrapper Radim Krčmář <rkrcmar@redhat.com> - 2015-08-05 18:40 +0200
    Re: [PATCH v2 1/5] KVM: add kvm_has_request wrapper Christian Borntraeger <borntraeger@de.ibm.com> - 2015-08-12 22:00 +0200
      Re: [PATCH v2 1/5] KVM: add kvm_has_request wrapper Radim Krčmář <rkrcmar@redhat.com> - 2015-08-13 11:20 +0200
        Re: [PATCH v2 1/5] KVM: add kvm_has_request wrapper Paolo Bonzini <pbonzini@redhat.com> - 2015-08-13 11:30 +0200
          Re: [PATCH v2 1/5] KVM: add kvm_has_request wrapper Christian Borntraeger <borntraeger@de.ibm.com> - 2015-08-13 12:10 +0200
            Re: [PATCH v2 1/5] KVM: add kvm_has_request wrapper Radim Krčmář <rkrcmar@redhat.com> - 2015-08-14 10:50 +0200
  Re: [PATCH v2 4/5] KVM: add KVM_USER_EXIT vcpu ioctl for userspace  exit Paolo Bonzini <pbonzini@redhat.com> - 2015-08-05 18:40 +0200
    Re: [PATCH v2 4/5] KVM: add KVM_USER_EXIT vcpu ioctl for userspace  exit Paolo Bonzini <pbonzini@redhat.com> - 2015-08-06 16:10 +0200
      Re: [PATCH v2 4/5] KVM: add KVM_USER_EXIT vcpu ioctl for userspace  exit Radim Krčmář <rkrcmar@redhat.com> - 2015-08-07 04:40 +0200
    Re: [PATCH v2 4/5] KVM: add KVM_USER_EXIT vcpu ioctl for userspace  exit Radim Krčmář <rkrcmar@redhat.com> - 2015-08-06 16:50 +0200
  [PATCH v2 3/5] KVM: x86: add request_exits debug counter Radim Krčmář <rkrcmar@redhat.com> - 2015-08-05 18:40 +0200
  [PATCH v2 5/5] KVM: refactor asynchronous vcpu ioctl dispatch Radim Krčmář <rkrcmar@redhat.com> - 2015-08-05 18:40 +0200
    Re: [PATCH v2 5/5] KVM: refactor asynchronous vcpu ioctl dispatch Christian Borntraeger <borntraeger@de.ibm.com> - 2015-08-12 22:10 +0200
      Re: [PATCH v2 5/5] KVM: refactor asynchronous vcpu ioctl dispatch Radim Krčmář <rkrcmar@redhat.com> - 2015-08-13 11:00 +0200
      Re: [PATCH v2 5/5] KVM: refactor asynchronous vcpu ioctl dispatch Paolo Bonzini <pbonzini@redhat.com> - 2015-08-13 11:30 +0200
  [PATCH v2 2/5] KVM: add KVM_REQ_EXIT request for userspace exit Radim Krčmář <rkrcmar@redhat.com> - 2015-08-05 18:40 +0200
  [PATCH v2 4/5] KVM: add KVM_USER_EXIT vcpu ioctl for userspace exit Radim Krčmář <rkrcmar@redhat.com> - 2015-08-05 18:40 +0200
    Re: [PATCH v2 4/5] KVM: add KVM_USER_EXIT vcpu ioctl for userspace  exit Avi Kivity <avi.kivity@gmail.com> - 2015-08-16 22:30 +0200
      Re: [PATCH v2 4/5] KVM: add KVM_USER_EXIT vcpu ioctl for userspace  exit Paolo Bonzini <pbonzini@redhat.com> - 2015-08-17 15:20 +0200
        Re: [PATCH v2 4/5] KVM: add KVM_USER_EXIT vcpu ioctl for userspace  exit Avi Kivity <avi.kivity@gmail.com> - 2015-08-18 20:40 +0200
          Re: [PATCH v2 4/5] KVM: add KVM_USER_EXIT vcpu ioctl for userspace  exit Paolo Bonzini <pbonzini@redhat.com> - 2015-08-18 22:00 +0200
            Re: [PATCH v2 4/5] KVM: add KVM_USER_EXIT vcpu ioctl for userspace  exit Avi Kivity <avi.kivity@gmail.com> - 2015-08-19 08:50 +0200

csiph-web