From: Alexander Graf Subject: Re: [PATCH] kvm tools: Add MMIO coalescing support Date: Sat, 4 Jun 2011 17:22:59 +0200 Message-ID: <1FAEB5EB-57FD-49D7-9D62-3494BC22F4BD@suse.de> References: <20110604093847.GB14524@elte.hu> <1307182441.7239.2.camel@lappy> <20110604101711.GB16292@elte.hu> <1307183318.7239.6.camel@lappy> <20110604103508.GE16292@elte.hu> <20110604104712.GG16292@elte.hu> <20110604112743.GA24146@elte.hu> <20110604144629.GA22189@elte.hu> Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8BIT Cc: Sasha Levin , penberg@kernel.org, kvm@vger.kernel.org, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com To: Ingo Molnar Return-path: Received: from cantor2.suse.de ([195.135.220.15]:39660 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756706Ab1FDPXC convert rfc822-to-8bit (ORCPT ); Sat, 4 Jun 2011 11:23:02 -0400 In-Reply-To: <20110604144629.GA22189@elte.hu> Sender: kvm-owner@vger.kernel.org List-ID: On 04.06.2011, at 16:46, Ingo Molnar wrote: > > * Alexander Graf wrote: > >> So the simple rule is: don't register a coalesced MMIO region for a >> region where latency matters. [...] > > So my first suspicion is confirmed. > > A quick look at Qemu sources shows that lots of drivers are using > coalesced_mmio without being aware of the latency effects and only > one seems to make use of qemu_flush_coalesced_mmio_buffer(). Drivers > like hw/e1000.c sure look latency critical to me. e1000 maps its NVRAM on coalesced mmio - which is completely ok. > So i maintain my initial opinion: this is a pretty dangerous > 'optimization' that should be used with extreme care: i can tell it > you with pretty good authority that latency problems are much more > easy to introduce than to find and remove ... Yup, which is why it's very sparsely used in qemu :). Basically, it's only e1000 and vga, both of which are heavily used and tested drivers. Alex