From: Paolo Bonzini Subject: Re: Question about KVM virtio network latency improvement Date: Thu, 13 Oct 2016 09:00:01 +0200 Message-ID: <7e391fc4-3ec8-29aa-d0f0-e8c3c3041732@redhat.com> References: <5bf114ba3c056c710a3f05e67acfee30@reolight.net> <967a9b2a-a36b-f151-72e1-12420c2810e4@gmail.com> <47236c6a0e121e5226bf73f9914aed5f@reolight.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: kvm@vger.kernel.org To: Greg , Yang Zhang Return-path: Received: from mail-lf0-f46.google.com ([209.85.215.46]:36451 "EHLO mail-lf0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751146AbcJMHAH (ORCPT ); Thu, 13 Oct 2016 03:00:07 -0400 Received: by mail-lf0-f46.google.com with SMTP id b75so119915104lfg.3 for ; Thu, 13 Oct 2016 00:00:07 -0700 (PDT) In-Reply-To: <47236c6a0e121e5226bf73f9914aed5f@reolight.net> Sender: kvm-owner@vger.kernel.org List-ID: On 12/10/2016 17:27, Greg wrote: >> > > Yes, you're partially right. > I've done some tests on how reduce interrupt latency. Using idle=poll or > use stress tests in guest permit to reduce half the latency (but is a > real hog on host :/). > Using "intel_idle.max_cstate=0 processor.max_cstate=0 idle=poll" on host > permits to get the same result (without cpu hog) > > In conclusion, I get with theses results : ~120µs between guest (from > 180µs previously). > > Running iperf with these new modifications still get better results with > ~60µs (a third from the initial value, half from idle=poll value). > > Is there something else I can eventually tune ? With a real workload, you might be able to get the same performance as idle=poll thanks to KVM's automatic polling for interrupts. As long as packets are delivered within 400 microseconds, and only if there is no other active process on the host's CPU, KVM will poll for guest interrupts instead of putting the guest's CPU to sleep. This of course doesn't trigger for ping, which only wakes up the guest once per second. Paolo