From patchwork Tue Jun 4 11:52:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 248540 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4815B2C00AB for ; Tue, 4 Jun 2013 21:52:28 +1000 (EST) Received: from localhost ([::1]:40779 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ujpmr-0007Rs-Mo for incoming@patchwork.ozlabs.org; Tue, 04 Jun 2013 07:52:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjpmX-0007RW-Hb for qemu-devel@nongnu.org; Tue, 04 Jun 2013 07:52:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjpmU-0001uy-GY for qemu-devel@nongnu.org; Tue, 04 Jun 2013 07:52:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjpmU-0001um-9i for qemu-devel@nongnu.org; Tue, 04 Jun 2013 07:52:02 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r54Bq1PW019990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 4 Jun 2013 07:52:01 -0400 Received: from redhat.com (dhcp-4-223.tlv.redhat.com [10.35.4.223]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id r54BpxZr025820; Tue, 4 Jun 2013 07:52:00 -0400 Date: Tue, 4 Jun 2013 14:52:35 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1370346682-22970-2-git-send-email-mst@redhat.com> References: <1370346682-22970-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1370346682-22970-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Marcelo Tosatti , kvm@vger.kernel.org, Gleb Natapov Subject: [Qemu-devel] [PATCH 2/2] kvm: skip system call when msi route is unchanged X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Some guests do a large number of mask/unmask calls which currently trigger expensive route update system calls. Detect that route in unchanged and skip the system call. Reported-by: "Zhanghaoyu (A)" Signed-off-by: Michael S. Tsirkin --- kvm-all.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kvm-all.c b/kvm-all.c index f119ce1..891722b 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1026,6 +1026,10 @@ static int kvm_update_routing_entry(KVMState *s, continue; } + if(!memcmp(entry, new_entry, sizeof *entry)) { + return 0; + } + *entry = *new_entry; kvm_irqchip_commit_routes(s);