From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S33hT-00020A-Q0 for qemu-devel@nongnu.org; Thu, 01 Mar 2012 05:57:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S33hO-0000P3-JD for qemu-devel@nongnu.org; Thu, 01 Mar 2012 05:57:31 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:53298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S33hO-0000On-D9 for qemu-devel@nongnu.org; Thu, 01 Mar 2012 05:57:26 -0500 Received: from euspt2 (mailout1.w1.samsung.com [210.118.77.11]) by mailout1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0M0700BLMD3IK4@mailout1.w1.samsung.com> for qemu-devel@nongnu.org; Thu, 01 Mar 2012 10:57:18 +0000 (GMT) Received: from [106.109.9.191] by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M0700A8ID3JXD@spt2.w1.samsung.com> for qemu-devel@nongnu.org; Thu, 01 Mar 2012 10:57:20 +0000 (GMT) Date: Thu, 01 Mar 2012 14:57:18 +0400 From: Evgeny Voevodin In-reply-to: Message-id: <4F4F560E.6060806@samsung.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=UTF-8 Content-transfer-encoding: QUOTED-PRINTABLE References: <1330340818-4125-1-git-send-email-e.voevodin@samsung.com> <1330344787-14482-1-git-send-email-e.voevodin@samsung.com> <4F4C4643.2080007@samsung.com> <4F4F31D2.7010608@suse.de> Subject: Re: [Qemu-devel] [PATCH v2] TCG: Convert global variables to be TLS. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: i.mitsyanko@samsung.com, qemu-devel@nongnu.org, kyungmin.park@samsung.com, d.solodkiy@samsung.com, m.kozlov@samsung.com, =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= On 01.03.2012 12:27, Peter Maydell wrote: > On 1 March 2012 08:22, Andreas F=C3=A4rber wrote= : >> Am 28.02.2012 04:13, schrieb Evgeny Voevodin: >>> On 27.02.2012 16:35, Peter Maydell wrote: >>>> A true multithreaded TCG is a large project, and unless we're >>>> going to commit to doing that I don't see much value in making >>>> some variables per-thread when we might instead need to do >>>> larger refactorings (properly encapsulating the codegen >>>> caches as qom objects, maybe?). >>> [...] qomification of translation caches is an interesting sugges= tion I >>> think. >> While I have come to like QOM and am using it for the CPUState, I = don't >> see the benefit in using it for these secondary structures. There = are >> already dedicated monitor commands to inspect them, no? > Mostly I was thinking about the encapsulation of knowing which data > structures are associated with a translation cache and letting you > have more than one of them. You could do that with a plain struct > but since we have this OO infrastructure now why not use it? > > -- PMM > Actually, I didn't dive deep enough in QOM and can't see any benefits= or=20 disadvantages in such encapsulation. As stands to me now, QOM is mostly an interface, = but=20 internal things are still structs :) And if we implement appropriate model for=20 multithreading TCG, I believe, that it could be easily wrapped with QOM, if needed. Also, there are at least two approaches for cache - unified for all= =20 VCPUs and exclusive for each VCPU. First is better when a lot of different threads run in the target, si= nce=20 each cache holds unique code and thread communication is small. Second is better when a lot of identical threads running since no= =20 excessive translation of identical code is made by each VCPU thread, but communication between threads on= =20 accessing the cache is high. So, what I'm talking about is if we use unified cache, we may not nee= d=20 to have more than one cache instance. --=20 Kind regards, Evgeny Voevodin, Leading Software Engineer, ASWG, Moscow R&D center, Samsung Electronics e-mail: e.voevodin@samsung.com