From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Booting from PV disk driver (Was: Re: [PATCH 10/13] KVM: Wire up hypercall handler ..) Date: Sun, 25 Feb 2007 08:52:03 +0200 Message-ID: <45E13213.5070502@qumranet.com> References: <45D979D3.2020907@qumranet.com> <20070219103052.4D23725016B@il.qumranet.com><20070221103733.GI3945@ucw.cz> <45DD6CF0.3010509@qumranet.com> <64F9B87B6B770947A9F8391472E032160A91BAF3@ehost011-8.exch011.intermedia.net> <1172140490.3531.236.camel@laptopd505.fenrus.org> <45DD7330.1030001@qumranet.com> <1172142081.3531.243.camel@laptopd505.fenrus.org> <45DF5943.3090304@codemonkey.ws> <1172269981.3241.57.camel@laptopd505.fenrus.org> <45E11C00.2000602@qumranet.com> <1172385067.3265.1.camel@laptopd505.fenrus.org> <45E12E08.8040402@qumranet.com> <1172385720.3265.12.camel@laptopd505.fenrus.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Arjan van de Ven Return-path: In-Reply-To: <1172385720.3265.12.camel-NIQFrBLA1CpScpXdPBN83iCwEArCW2h5@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Arjan van de Ven wrote: >>> shared interrupts aren't a big deal in Linux. at all. >>> In fact, sharing all PV interrupts to one number is a performance >>> enhancement ;) >>> >>> >> If you share a PV interrupt with a non-PV interrupt, then for each PV >> interrupt you have to check whether the non-PV interrupt fired. That >> involves at least one expensive vmexit. >> > > hmm not really. > the completion ring lives in guest memory, the guest can check it > without vmexit entirely. > The PV block driver only does 2 vm events normally (apart from boot time > setup), one to inform the host new IO has been submitted in the submit > ring, and one to receive an interrupt to get notified one or more > completions are present in the completion ring. Nothing more.... > > But doesn't the interrupt code have to check all interrupt sources on a shared line? That means checking the non-PV interrupt as well, which involves a vmexit (for mmio read). >> I agree that sharing PV interrupts is not very expensive (though I don't >> see why you call it an optimization - if you share 100 interrupts on one >> line you need to check 100 interrupt sources every time the interrupt >> fires). >> > > as long as the check is cheap that is actually fine; if in your 100 > sources scenario 10 have fired, you only get 1 vm event to deliver the > irq, and then 100 polls of guest memory inside the guest. That should be > cheaper than doing 10 real vm interrupts. > It is possible (Xen does it) to batch interrupt delivery so that multiple interrupts can be delivered with one vmentry. So you get the best of both worlds: one check for interrupt source, and one vmentry if multiple interrupts have fired. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV