From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpecV-00089b-Hs for qemu-devel@nongnu.org; Thu, 20 Jun 2013 09:09:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpecP-00088U-HH for qemu-devel@nongnu.org; Thu, 20 Jun 2013 09:09:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpecP-00088O-92 for qemu-devel@nongnu.org; Thu, 20 Jun 2013 09:09:41 -0400 Date: Thu, 20 Jun 2013 16:10:25 +0300 From: "Michael S. Tsirkin" Message-ID: <1371730033-5554-8-git-send-email-mst@redhat.com> References: <1371730033-5554-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1371730033-5554-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 07/21] kvm: skip system call when msi route is unchanged List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , kvm@vger.kernel.org, Gleb Natapov 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); -- MST