From patchwork Sat May 7 02:34:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 763952 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p472a0nC001344 for ; Sat, 7 May 2011 02:36:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754931Ab1EGCf5 (ORCPT ); Fri, 6 May 2011 22:35:57 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:34598 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754067Ab1EGCf5 (ORCPT ); Fri, 6 May 2011 22:35:57 -0400 Received: by pzk9 with SMTP id 9so1667050pzk.19 for ; Fri, 06 May 2011 19:35:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=QEovqaPY3fPws/BAOHYRFso+odwyn/bAAjiqRaRbQY0=; b=si+5TUKL8xEy+Gr1L8RBHYO22X22J2Sz4WzopGOj37Oey5sRCQvcWwFi+V1FKGPvR4 g74ADO0YBexCz4xmBwcWFgb9yzqZQ4QGf8Cehge43sDya0X2jNtDvVD2cup6/0HXyqcZ 2dTyimw+YD4XONgMtGgYZgt1Q5ujHWiCcPK2w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=Kj6Yqx+ngdvTOqbyo6I1n6vjP1IWIQTRKvtWrfGcIJQk+6lD7G8y2qRMV7koV0bgTK rPFl3b9F97f0ATmCRsQjpOzNgyVHNHLVDK88rNU/UHTwOTQpfamnW1b1gEnwkt2a6Ygl BKXd6o5biPBwQFA+p6O+KH0VFeNDzzfr1Em5M= Received: by 10.68.15.71 with SMTP id v7mr1284652pbc.116.1304735756805; Fri, 06 May 2011 19:35:56 -0700 (PDT) Received: from localhost.localdomain ([202.112.128.133]) by mx.google.com with ESMTPS id d9sm2519443pba.16.2011.05.06.19.35.51 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 06 May 2011 19:35:56 -0700 (PDT) From: Asias He To: Pekka Enberg , Cyrill Gorcunov , Ingo Molnar , Sasha Levin , Prasad Joshi Cc: kvm@vger.kernel.org, Asias He Subject: [PATCH 2/2] kvm tools: Respect VRING_AVAIL_F_NO_INTERRUPT Date: Sat, 7 May 2011 10:34:20 +0800 Message-Id: <1304735660-10844-2-git-send-email-asias.hejun@gmail.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1304735660-10844-1-git-send-email-asias.hejun@gmail.com> References: <1304735660-10844-1-git-send-email-asias.hejun@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 07 May 2011 02:36:00 +0000 (UTC) Do not inject IRQ when guest suppress it. This can reduce IRQ injection further and bumps host to guest bandwitdh to 6178.78 Mbps(cpu 63.96%). Signed-off-by: Asias He --- tools/kvm/virtio/core.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/tools/kvm/virtio/core.c b/tools/kvm/virtio/core.c index 0734984..2b3503d 100644 --- a/tools/kvm/virtio/core.c +++ b/tools/kvm/virtio/core.c @@ -60,6 +60,9 @@ u16 virt_queue__get_iov(struct virt_queue *queue, struct iovec iov[], u16 *out, void virt_queue__trigger_irq(struct virt_queue *vq, int irq, u8 *isr, struct kvm *kvm) { + if (vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT) + return; + if (*isr == VIRTIO_IRQ_LOW) { *isr = VIRTIO_IRQ_HIGH; kvm__irq_line(kvm, irq, VIRTIO_IRQ_HIGH);