Received: from eggs.gnu.org ([2001:4830:134:3::10]:52103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXqbR-0007cC-5z for qemu-devel@nongnu.org; Fri, 04 Sep 2015 09:00:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXqbL-0001LD-Q6 for qemu-devel@nongnu.org; Fri, 04 Sep 2015 09:00:25 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:51085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXqbL-0001Jm-Fd for qemu-devel@nongnu.org; Fri, 04 Sep 2015 09:00:19 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <87fv2uipzf.fsf@linaro.org> <55E9638D.4010006@redhat.com> <20150904094158.GA12618@toto> <9459DA03-0B3C-465E-8636-5A6FB469B37B@greensocs.com> Date: Fri, 04 Sep 2015 15:00:01 +0200 In-Reply-To: <9459DA03-0B3C-465E-8636-5A6FB469B37B@greensocs.com> (Mark Burton's message of "Fri, 4 Sep 2015 12:18:38 +0200") Message-ID: <87pp1ynxv2.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] MTTCG Tasks (kvmforum summary) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Burton Cc: "Edgar E. Iglesias" , mttcg@greensocs.com, Alexander Spyridakis , Claudio Fontana , qemu-devel , Alvise Rigo , "Emilio G. Cota" , Paolo Bonzini , "Edgar E. Iglesias" , Alex =?utf-8?Q?Benn=C3=A9e?= , KONRAD =?utf-8?B?RnI=?= =?utf-8?B?w6lkw6lyaWM=?= Mark Burton writes: [...] >>>> * What to do about icount? >>>>=20 >>>> What is the impact of multi-thread on icount? Do we need to disable it >>>> for MTTCG or can it be correct per-cpu? Can it be updated lock-step? >>>>=20 >>>> We need some input from the guys that use icount the most. >>>=20 >>> That means Edgar. :) >>=20 >> Hi! >>=20 >> IMO it would be nice if we could run the cores in some kind of lock-step >> with a configurable amount of instructions that they can run ahead >> of time (X). >>=20 >> For example, if X is 10000, every thread/core would checkpoint at >> 10000 insn boundaries and wait for other cores. Between these >> checkpoints, the cores will not be in sync. We might need to >> consider synchronizing at I/O accesses aswell to avoid weird >> timing issues when reading counter registers for example. >>=20 >> Of course the devil will be in the details but an approach roughly >> like that sounds useful to me. > And =E2=80=9Cworks" in other domains. > Theoretically we dont need to sync at IO (Dynamic quantums), for most sys= tems > that have =E2=80=99normal' IO its normally less efficient I believe. Howe= ver, the > trouble is, the user typically doesn=E2=80=99t know, and mucking about wi= th quantum > lengths, dynamic quantum switches etc is probably a royal pain in the but= t. And > if you dont set your quantum right, the thing will run really slowly (or = will > break)=E2=80=A6 > The choices are a rock or a hard place. Dynamic quantums risk to be slow = (you=E2=80=99ll > be forcing an expensive =E2=80=99sync=E2=80=99 - all CPU=E2=80=99s will h= ave to exit etc) on each IO > access from each core=E2=80=A6. not great. Syncing with host time (e.g. e= ach CPU tries > to sync with host clock as best it can) will fail when one or other CPU c= an=E2=80=99t > keep up=E2=80=A6. In the end you end up with leaving the user with a nice= long bit of > string and a message saying =E2=80=9Chang yourself here=E2=80=9D. That price would not be paid when icount is disabled. Well, the code comple= xity price is always paid... I meant runtime :) Then, I think this depends on what type of guarantees you require from icount. I see two possible semantics: * All CPUs are *exactly* synchronized at icount granularity This means that every icount instructions everyone has to stop and synchronize. * All CPUs are *loosely* synchronized at icount granularity You can implement it in a way that ensures that every cpu has *at least* reached a certain timestamp. So cpus can keep on running nonetheless. The downside is that the latter loses the ability for reproducible runs, wh= ich IMHO are useful. A more complex option is to merge both: icount sets the "synchronization granularity" and another parameter sets the maximum delta between cpus (i.e., set it to 0 to have the first option, and infinite for = the second). Cheers, Lluis --=20 "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth