From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] kvm: Flush coalesced MMIO buffer periodly Date: Thu, 21 Jan 2010 12:19:49 +0200 Message-ID: <4B582A45.3020404@redhat.com> References: <1264066640-25577-1-git-send-email-sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Sheng Yang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:22962 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754994Ab0AUKTw (ORCPT ); Thu, 21 Jan 2010 05:19:52 -0500 In-Reply-To: <1264066640-25577-1-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On 01/21/2010 11:37 AM, Sheng Yang wrote: > The default action of coalesced MMIO is, cache the writing in buffer, until: > 1. The buffer is full. > 2. Or the exit to QEmu due to other reasons. > > But this would result in a very late writing in some condition. > 1. The each time write to MMIO content is small. > 2. The writing interval is big. > 3. No need for input or accessing other devices frequently. > > This issue was observed in a experimental embbed system. The test image > simply print "test" every 1 seconds. The output in QEmu meets expectation, > but the output in KVM is delayed for seconds. > > Per Avi's suggestion, I add a periodly flushing coalesced MMIO buffer in > QEmu IO thread. By this way, We don't need vcpu explicit exit to QEmu to > handle this issue. Current synchronize rate is 1/25s. > > I'm not sure that a new timer is needed. If the only problem case is the display, maybe we can flush coalesced mmio from the vga refresh timer. That ensures that we flash exactly when needed, and don't have extra timers. -- error compiling committee.c: too many arguments to function