From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X35X7-0002h6-Km for qemu-devel@nongnu.org; Fri, 04 Jul 2014 11:36:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X35X3-00087T-J6 for qemu-devel@nongnu.org; Fri, 04 Jul 2014 11:36:17 -0400 Received: from zimbra3.corp.accelance.fr ([2001:4080:204::2:8]:40408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X35X3-00087G-9z for qemu-devel@nongnu.org; Fri, 04 Jul 2014 11:36:13 -0400 Date: Fri, 4 Jul 2014 17:36:06 +0200 (CEST) From: Sebastian Tanase Message-ID: <2082461657.19366315.1404488165989.JavaMail.root@openwide.fr> In-Reply-To: <53B19B80.5060000@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH V3 0/6] icount: Implement delay algorithm between guest and host clocks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, peter maydell , aliguori@amazon.com, wenchaoqemu@gmail.com, quintela@redhat.com, qemu-devel@nongnu.org, mjt@tls.msk.ru, mst@redhat.com, stefanha@redhat.com, armbru@redhat.com, lcapitulino@redhat.com, michael@walle.cc, alex@alex.org.uk, crobinso@redhat.com, afaerber@suse.de, rth@twiddle.net ----- Mail original ----- > De: "Paolo Bonzini" > =C3=80: "Sebastian Tanase" , qemu-devel@non= gnu.org > Cc: aliguori@amazon.com, afaerber@suse.de, rth@twiddle.net, "peter maydel= l" , > michael@walle.cc, alex@alex.org.uk, stefanha@redhat.com, lcapitulino@redh= at.com, crobinso@redhat.com, > armbru@redhat.com, wenchaoqemu@gmail.com, quintela@redhat.com, kwolf@redh= at.com, mjt@tls.msk.ru, mst@redhat.com > Envoy=C3=A9: Lundi 30 Juin 2014 19:16:48 > Objet: Re: [RFC PATCH V3 0/6] icount: Implement delay algorithm between g= uest and host clocks >=20 > Il 30/06/2014 15:59, Sebastian Tanase ha scritto: > > The icount option already implemented in QEMU allows the guest to > > run at a theoretical > > frequency of 1/(2^N) GHz (N is the icount parameter). The goal of > > this patch is to have a > > real guest frequency close to the one imposed by using the icount > > option. > > > > The main idea behind the algorithm is that we compare the virtual > > monotonic clock and the > > host monotonic clock. For big icounts (on our test machine, an i5 > > CPU @ 3.10GHz, icounts > > starting at 6) the guest clock will be ahead of the host clock. In > > this case, we try to > > sleep QEMU for the difference between the 2 clocks. Therefore, the > > guest would have > > executed for a period almost equally to the one imposed by icount. > > We should point out > > that the algorithm works only for those icounts that allow the > > guest clock to be in front > > of the host clock. > > > > The first patch adds support for QemuOpts for the 'icount' > > parameter. It also adds a > > suboption called 'shift' that will hold the value for 'icount'. > > Therefore we now have > > -icount shift=3DN|auto or -icount N|auto. > > > > The second patch adds the 'align' suboption for icount. > > > > The third patch exports 'icount_time_shift' so that it can be used > > in places other than > > cpus.c; we need it in cpu-exec.c for calculating for how long we > > want QEMU to sleep. > > > > The forth patch implements the algorithm used for calculating the > > delay we want to sleep. > > It uses the number of instructions executed by the virtual cpu and > > also the icount_time_shift. > > > > The fifth patch prints to the console whenever the guest clock runs > > behind the host > > clock. The fastest printing speed is every 2 seconds, and we only > > print if the align option > > is enabled. We also have a limit to 100 printed messages. > > > > The sixth patch adds information about the difference between the > > host and guest clocks > > (taking into account the offset) in the 'info jit' command. We also > > print the maximum > > delay and advance of the guest clock compared to the host clock. >=20 > I think the changes I made are too big to get this in 2.1, but we can > certainly get this very early in 2.2 instead. I'll shortly push my > changes to an "icount" branch at github.com/bonzini/qemu.git. Can > you > look at it and rebase patches 5 and 6 on top (plus the small change I > asked for in my review of patch 2)? >=20 > Thanks, >=20 > Paolo >=20 >=20 I've also made some changes to patch 4 (added Sleep() function call when co= mpiling for Windows and other small modifications); is it ok if I merge them with t= he existing patch 4 on your "icount" branch and then rebase the other patches? Sebastian