From: Ingo Molnar Subject: Re: [PATCH 1/2] kvm tools: Respect ISR status in virtio header Date: Sat, 7 May 2011 16:02:51 +0200 Message-ID: <20110507140251.GB2859@elte.hu> References: <1304735660-10844-1-git-send-email-asias.hejun@gmail.com> <20110507093027.GD27657@elte.hu> <4DC545BA.3030501@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Asias He , "Michael S. Tsirkin" , Rusty Russell , Mark McLoughlin , Pekka Enberg , Cyrill Gorcunov , Sasha Levin , Prasad Joshi , kvm@vger.kernel.org To: Anthony Liguori Return-path: Received: from mx3.mail.elte.hu ([157.181.1.138]:49404 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754618Ab1EGODB (ORCPT ); Sat, 7 May 2011 10:03:01 -0400 Content-Disposition: inline In-Reply-To: <4DC545BA.3030501@us.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: * Anthony Liguori wrote: > When using PCI LNK interrupts, the ISR flag serves two purposes. It > indicates that an interrupt was raised (since the actual interrupt line may > be shared) and it is used to acknowledge the interrupt (since PCI LNK lines > are level triggered). ok. > It seems like this patch is simply avoiding raising the interrupt line if the > ISR has not been acknowledged yet. I don't think there's a functional issue > here [...] Thanks for confirming this - so i think we still do not understand the root cause of the ping latency and why this change fixed it ... > [...] but I'm surprised that it's a win. There should be a very short window > when the interrupt is lowered in the APIC but still not acknowledged in the > ISR. > > You should just be saving a pretty cheap system call. I wonder if the system > call is taking longer than it should.. Well the optimization also avoids unnecessary VM exits (due to the injection, which interrupts a guest context immediately, even if it's running on another CPU), not just system calls - so it could be more expensive than a system call, right? Thanks, Ingo