Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LeZpY-00008f-Al for qemu-devel@nongnu.org; Tue, 03 Mar 2009 13:59:04 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LeZpX-00007Z-JO for qemu-devel@nongnu.org; Tue, 03 Mar 2009 13:59:03 -0500 Received: from [199.232.76.173] (port=35003 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LeZpX-00007O-Eg for qemu-devel@nongnu.org; Tue, 03 Mar 2009 13:59:03 -0500 Received: from soufre.accelance.net ([213.162.48.15]:65474) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LeZpW-0005Wt-BN for qemu-devel@nongnu.org; Tue, 03 Mar 2009 13:59:03 -0500 Received: from [192.168.1.22] (APlessis-Bouchard-151-1-60-87.w83-112.abo.wanadoo.fr [83.112.126.87]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by soufre.accelance.net (Postfix) with ESMTP id F1F7E455C8 for ; Tue, 3 Mar 2009 19:58:59 +0100 (CET) Subject: Re: [Qemu-devel] sh : performance problem From: Lionel Landwerlin In-Reply-To: <49AD50E2.7000401@juno.dti.ne.jp> References: <49A6C317.1080202@juno.dti.ne.jp> <1236038327.4975.16.camel@coalu.atr> <49AD50E2.7000401@juno.dti.ne.jp> Content-Type: text/plain; charset=utf-8 Date: Tue, 03 Mar 2009 19:57:57 +0100 Message-Id: <1236106677.16018.5.camel@couak.urd44.com> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Le mercredi 04 mars 2009 =C3=A0 00:46 +0900, Shin-ichiro KAWASAKI a =C3=A9= crit : > Lionel Landwerlin wrote: > > Shin-ichiro, > >=20 > > Sorry, but I cannot apply your patch cleanly on the last qemu-svn. > >=20 > > Instead, I would like to try another approach. The patch you proposed= to > > find (or not) a valid TLB entry has a complexity of O(log2(n)) (or > > something like that if I remember) instead here is a patch with a > > complexity of O(1). >=20 > Good work. I evaluated your patch on my environment, measuring > compile time for empty main() with gcc. >=20 > sh4 : 5.8 [seconds] O(n) utlb search. > sh4 : 4.6 [seconds] O(log2(n)) utlb search. > sh4 : 4.1 [seconds] O(1) utlb search by Lionel > arm : 0.8 [seconds] (-M versatilepb + Debian ARM) >=20 > Your patch has a nice score! Great :) But we're still far from arm :( >=20 > Now I've done the work to increase number of utlb entries from 64 to 25= 6, > and found that the score get arround 2.4 seconds. > I'm trying to increase it to 4096. Your O(1) search will be more impor= tant > as the entry number increase. >=20 What do you mean by more important ? Is the arm emulation increasing the number of TLB ? > > +#if !defined(CONFIG_USER_ONLY) > > + /* vpn to utlb entry caches (too much space for user emulation) = */ > > + uint8_t utlbs_1k[4194304]; /* 222 =3D> 4 Mb */ > > + uint8_t utlbs_4k[1048576]; /* 220 =3D> 1 Mb */ > > + uint8_t utlbs_64k[65536]; /* 216 =3D> 64 Kb */ > > + uint8_t utlbs_1m[4096]; /* 212 =3D> 4 Kb */ > > +#endif > > } CPUSH4State; >=20 > Isn't it too gorgeous? > How about allocating them on demand? > I guess sh-linux uses only utlbs_4k[], in general. > If so, 4 Mb utlbs_1k[] is waste. >=20 sh-linux can also use huge pages of 64k and 1M. I think it is important to keep the emulation as close as possible from the real the cpu capabilities. Regards, --=20 Lionel Landwerlin