From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kt3xZ-0001PL-Vd for qemu-devel@nongnu.org; Thu, 23 Oct 2008 13:26:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kt3xY-0001OP-Dh for qemu-devel@nongnu.org; Thu, 23 Oct 2008 13:26:56 -0400 Received: from [199.232.76.173] (port=35116 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kt3xY-0001OM-94 for qemu-devel@nongnu.org; Thu, 23 Oct 2008 13:26:56 -0400 Received: from mx2.redhat.com ([66.187.237.31]:41789) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kt3xV-0005Ir-Na for qemu-devel@nongnu.org; Thu, 23 Oct 2008 13:26:56 -0400 Date: Thu, 23 Oct 2008 13:26:32 -0400 (EDT) From: Glauber de Oliveira Costa Message-ID: <391190915.2897471224782791753.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> In-Reply-To: <4900882A.30909@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 20/32] accel_trace_io Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: jan kiszka , Glauber Costa , jes@sgi.com, qemu-devel@nongnu.org, avi@qumranet.com, dmitry baryshkov ----- "Anthony Liguori" wrote: > Glauber Costa wrote: > > From: Glauber Costa > > > > kqemu keeps trace of the last io done. Do it through > > an accel_wrapper. > > > > The hooks here are probably not the best they could be. The purpose > of > this code in kqemu, from what I can tell, is to control how long we > run > in softmmu before trying to run in the kernel again. I presume this > is > mainly for kernel-kqemu. > > When kernel-kqemu encounters an instruction it can't handle, it drops > to > userspace and runs in softmmu for a while. The question is how long > should it run in softmmu and this is a heuristic. This is what the > code > is doing. > > Regards, My proposal is: * add a hook for in and another for out operations. It's generic enough to be useful for other purposes in the future. KVM does not need to do anything in here, and kqemu can just record the last io time * add a hook at th end of cpu_exec, that allows the accel to shut off current execution based on any criteria it wants to. accel_break_loop (the current one) seems a fine name for it. To be even more explicit, the accel can just return 1 or 0 indicating whether or not the current execution loop should be stopped, and cpu_loop_exit() is called based on the return value. What do you think?