From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IzGWy-0005vK-E5 for qemu-devel@nongnu.org; Mon, 03 Dec 2007 14:00:36 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IzGWw-0005t9-Ne for qemu-devel@nongnu.org; Mon, 03 Dec 2007 14:00:36 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IzGWw-0005ss-IB for qemu-devel@nongnu.org; Mon, 03 Dec 2007 14:00:34 -0500 Received: from ecfrec.frec.bull.fr ([129.183.4.8]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IzGWv-0000eu-O2 for qemu-devel@nongnu.org; Mon, 03 Dec 2007 14:00:34 -0500 Received: from localhost (localhost [127.0.0.1]) by ecfrec.frec.bull.fr (Postfix) with ESMTP id 2353B19D948 for ; Mon, 3 Dec 2007 20:00:31 +0100 (CET) Received: from ecfrec.frec.bull.fr ([127.0.0.1]) by localhost (ecfrec.frec.bull.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 01789-09 for ; Mon, 3 Dec 2007 20:00:27 +0100 (CET) Received: from ecn002.frec.bull.fr (ecn002.frec.bull.fr [129.183.4.6]) by ecfrec.frec.bull.fr (Postfix) with ESMTP id 6584519D909 for ; Mon, 3 Dec 2007 20:00:27 +0100 (CET) Subject: Re: [Qemu-devel] [PATCH 2/2 v2] Direct IDE I/O From: Laurent Vivier In-Reply-To: <475426C7.20503@codemonkey.ws> References: <11966765602186@bull.net> <4753D920.4060500@bellard.org> <1196677804.5275.5.camel@frecb07144> <475426C7.20503@codemonkey.ws> Date: Mon, 03 Dec 2007 20:00:18 +0100 Message-Id: <1196708418.5587.10.camel@frecb07144> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-8cxKORvLY4CYzyVBAG8p" 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 --=-8cxKORvLY4CYzyVBAG8p Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Le lundi 03 d=C3=A9cembre 2007 =C3=A0 09:54 -0600, Anthony Liguori a =C3=A9= crit : > Laurent Vivier wrote: > > Le lundi 03 d=C3=A9cembre 2007 =C3=A0 11:23 +0100, Fabrice Bellard a = =C3=A9crit : > > =20 > >> Laurent Vivier wrote: > >> =20 > >>> This patch enhances the "-drive ,cache=3Doff" mode with IDE drive emu= lation > >>> by removing the buffer used in the IDE emulation. > >>> --- > >>> block.c | 10 +++ > >>> block.h | 2=20 > >>> block_int.h | 1=20 > >>> cpu-all.h | 1=20 > >>> exec.c | 19 ++++++ > >>> hw/ide.c | 176 +++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++--- > >>> vl.c | 1=20 > >>> 7 files changed, 204 insertions(+), 6 deletions(-) > >>> =20 > >> What's the use of keeping the buffered case ? > >> =20 > > > > Well, I don't like to remove code written by others... > > and I don't want to break something. > > > > But if you think I should remove the buffered case, I can. > > > > BTW, do you think I should enable "cache=3Doff" by default ? > > Or even remove the option from the command line and always use > > O_DIRECT ? > > =20 >=20 > Hi Laurent, Hi Anthony, > Have you done any performance testing? Buffered IO should absolutely=20 > beat direct IO simply because buffered IO allows writes to complete=20 > before they actually hit disk. I've observed this myself. Plus the=20 > host typically has a much larger page cache then the guest so the second=20 > level of caching helps an awful lot. I don't have real benchmarks. I just saw some improvements with dbench (which is not a good benchmark, I know...) Direct I/O can be good in some cases (because it avoids multiple copies) and good in others (because it avoids disk access, and as you say it doesn't wait I/O completion). But there are at least two other good reasons to use it: - reliability: by avoiding cache we improve probability of data are on disk (and the ordering of I/O). And as you say, as we wait write completion, we are sure data have been written. - isolation: it allows to avoid to pollute host cache with guest data (and if we have several guests, it avoids to have performance impact at the cache level between guests). But there is no perfect solution, it's why I think it's good thing to let the choice to the user. Laurent -=20 --=20 ------------- Laurent.Vivier@bull.net -------------- "Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke --=-8cxKORvLY4CYzyVBAG8p Content-Type: application/pgp-signature; name=signature.asc Content-Description: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?= -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBHVFJC9Kffa9pFVzwRAhbSAKDNwPuiemuv3oqhfiBeSj6ToN8U7QCfQ1gF m3UjD15j5XhOf18gA/IGM04= =ogR6 -----END PGP SIGNATURE----- --=-8cxKORvLY4CYzyVBAG8p--