From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JtIrS-00066n-TT for qemu-devel@nongnu.org; Tue, 06 May 2008 04:49:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JtIrR-00066H-FV for qemu-devel@nongnu.org; Tue, 06 May 2008 04:49:21 -0400 Received: from [199.232.76.173] (port=33073 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JtIrR-00065w-8v for qemu-devel@nongnu.org; Tue, 06 May 2008 04:49:21 -0400 Received: from mx2.suse.de ([195.135.220.15]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JtIrR-0003Zf-3Z for qemu-devel@nongnu.org; Tue, 06 May 2008 04:49:21 -0400 Message-ID: <48201A71.3040405@suse.de> Date: Tue, 06 May 2008 10:44:33 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Align file accesses with cache=off (O_DIRECT) References: <4807514B.9040607@suse.de> <200804302305.42741@kevin-wolf.de> <200805011955.00265@kevin-wolf.de> In-Reply-To: <200805011955.00265@kevin-wolf.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 Cc: Blue Swirl , Laurent Vivier Kevin Wolf schrieb: > Am Donnerstag, 1. Mai 2008 16:35:51 schrieb Blue Swirl: >> On 5/1/08, Kevin Wolf wrote: >>> Am Mittwoch, 30. April 2008 16:30:27 schrieb Blue Swirl: >>>> Maybe the alignment could be handled like AIO and synchronous IO >>>> >>> > emulation layers are added in bdrv_register, but at open stage? >>> >>> You mean to preserve the original pread if the file is opened without >>> O_DIRECT and replace it by the emulation function only if O_DIRECT is >>> really used? >> Right. >> >> Maybe it's slightly faster that way and it would be closer to how >> other block emulations are handled. It's just an idea. > > Maybe I'm missing something but AFAIK this pread pointer exists once for each > block driver, i.e. every raw image uses the original pread or every raw image > uses the emulating one. The difference between the O_DIRECT case and the > AIO/sync emulation is that AIO/sync is the same for all devices of one driver > while O_DIRECT can differ between images of the same driver. > > So you would need to have one common pread which in turn calls a function > pointer stored in the BlockDriverState. I doubt that this is much cheaper > than an if in pread. And it wouldn't get too close to other emulations anyway > because of the driver/device difference. Should I change the patch now (even if I think it doesn't help anything) or will you apply the patch as it is? It is quite frustrating to get no answer at all. Kevin