From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JqzmO-0000cv-1T for qemu-devel@nongnu.org; Tue, 29 Apr 2008 20:02:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JqzmK-0000cO-2Q for qemu-devel@nongnu.org; Tue, 29 Apr 2008 20:02:34 -0400 Received: from [199.232.76.173] (port=37359 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JqzmJ-0000cA-MH for qemu-devel@nongnu.org; Tue, 29 Apr 2008 20:02:31 -0400 Received: from mail2.shareable.org ([80.68.89.115]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JqzmJ-000555-F6 for qemu-devel@nongnu.org; Tue, 29 Apr 2008 20:02:31 -0400 Date: Wed, 30 Apr 2008 01:02:19 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] [PATCH] Align file accesses with cache=off (O_DIRECT) Message-ID: <20080430000217.GB25408@shareable.org> References: <4807514B.9040607@suse.de> <4815EE89.70407@suse.de> <1209459667.4328.7.camel@frecb07144> <48173591.9010609@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48173591.9010609@suse.de> 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: Laurent Vivier Kevin Wolf wrote: > Disabling O_DIRECT for a single aio request is impossible (after all, > aio is asynchronous), and disabling it for at least one aio request is > going to be ugly. You could try opening two fds to the same file/blockdev, one with O_DIRECT set. Then you can disable O_DIRECT as you like per aio request, by choosing the fd. I'm not sure if that works, though. On some OSes, if a file has any non-O_DIRECT open descriptor, all I/O is buffered ignoring the O_DIRECT flag. If both are allowed simultaneously, I'm not sure what happens with cache-coherency between direct I/Os and buffered I/Os. -- Jamie