Received: from eggs.gnu.org ([2001:4830:134:3::10]:53932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXqkw-0004Ze-7r for qemu-devel@nongnu.org; Fri, 04 Sep 2015 09:10:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXqks-0005rO-3l for qemu-devel@nongnu.org; Fri, 04 Sep 2015 09:10:14 -0400 Received: from smtp.ispras.ru ([83.149.199.79]:42644) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXqkr-0005rC-NZ for qemu-devel@nongnu.org; Fri, 04 Sep 2015 09:10:10 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Date: Fri, 04 Sep 2015 16:10:05 +0300 From: dovgaluk In-Reply-To: <87pp1ynxv2.fsf@fimbulvetr.bsc.es> References: <87fv2uipzf.fsf@linaro.org> <55E9638D.4010006@redhat.com> <20150904094158.GA12618@toto> <9459DA03-0B3C-465E-8636-5A6FB469B37B@greensocs.com> <87pp1ynxv2.fsf@fimbulvetr.bsc.es> Message-ID: <34d8946d03abc7568bb92085bf406de0@ispras.ru> 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: =?UTF-8?Q?Llu=C3=ADs_Vilanova?= Cc: "Edgar E. Iglesias" , mttcg@greensocs.com, Paolo Bonzini , Claudio Fontana , Mark Burton , Alvise Rigo , qemu-devel , "Emilio G. Cota" , Alexander Spyridakis , "Edgar E. Iglesias" , mttcg-request@listserver.greensocs.com, =?UTF-8?Q?Alex_Benn=C3=A9e?= , =?UTF-8?Q?KONRAD_Fr=C3=A9d=C3=A9ric?= Llu=C3=ADs Vilanova =D0=BF=D0=B8=D1=81=D0=B0=D0=BB 2015-09-04 16:00: > Mark Burton writes: > [...] >>>>> * What to do about icount? >>>>>=20 >>>>> What is the impact of multi-thread on icount? Do we need to disable= =20 >>>>> it >>>>> for MTTCG or can it be correct per-cpu? Can it be updated=20 >>>>> 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=20 >>> 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. >=20 >> And =E2=80=9Cworks" in other domains. >> Theoretically we dont need to sync at IO (Dynamic quantums), for most=20 >> systems >> that have =E2=80=99normal' IO its normally less efficient I believe. H= owever,=20 >> the >> trouble is, the user typically doesn=E2=80=99t know, and mucking about= with=20 >> quantum >> lengths, dynamic quantum switches etc is probably a royal pain in the=20 >> butt. And >> if you dont set your quantum right, the thing will run really slowly=20 >> (or will >> break)=E2=80=A6 >=20 >> The choices are a rock or a hard place. Dynamic quantums risk to be=20 >> slow (you=E2=80=99ll >> be forcing an expensive =E2=80=99sync=E2=80=99 - all CPU=E2=80=99s wil= l have to exit etc) on=20 >> each IO >> access from each core=E2=80=A6. not great. Syncing with host time (e.g= . each=20 >> CPU tries >> to sync with host clock as best it can) will fail when one or other=20 >> CPU can=E2=80=99t >> keep up=E2=80=A6. In the end you end up with leaving the user with a n= ice long=20 >> bit of >> string and a message saying =E2=80=9Chang yourself here=E2=80=9D. >=20 > That price would not be paid when icount is disabled. Well, the code=20 > complexity > price is always paid... I meant runtime :) >=20 > Then, I think this depends on what type of guarantees you require from > icount. I see two possible semantics: >=20 > * All CPUs are *exactly* synchronized at icount granularity >=20 > This means that every icount instructions everyone has to stop and > synchronize. >=20 > * All CPUs are *loosely* synchronized at icount granularity >=20 > You can implement it in a way that ensures that every cpu has *at=20 > least* > reached a certain timestamp. So cpus can keep on running nonetheless. >=20 Is the third possibility looks sane? * All CPUs synchronize at shared memory operations. When somebody tries to read/write shared memory, it should wait until=20 all others will reach the same icount. > The downside is that the latter loses the ability for reproducible=20 > runs, which > IMHO are useful. A more complex option is to merge both: icount sets=20 > the > "synchronization granularity" and another parameter sets the maximum=20 > delta > between cpus (i.e., set it to 0 to have the first option, and infinite=20 > for the > second). Pavel Dovgalyuk