From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBnJO-0006tj-U4 for qemu-devel@nongnu.org; Fri, 07 Feb 2014 10:25:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WBnJH-0006kR-6H for qemu-devel@nongnu.org; Fri, 07 Feb 2014 10:25:50 -0500 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:43113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBnJG-0006kN-D0 for qemu-devel@nongnu.org; Fri, 07 Feb 2014 10:25:43 -0500 Received: from /spool/local by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 8 Feb 2014 01:25:35 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id E06523578052 for ; Sat, 8 Feb 2014 02:25:32 +1100 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s17F61c457016384 for ; Sat, 8 Feb 2014 02:06:01 +1100 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s17FPV8d018258 for ; Sat, 8 Feb 2014 02:25:32 +1100 Date: Fri, 7 Feb 2014 20:57:35 +0530 From: Bharata B Rao Message-ID: <20140207152734.GA16215@in.ibm.com> References: <925f4c0a62291c070991d1b3e75a770de986a686.1391541706.git.jcody@redhat.com> <20140205192535.GA3440@irqsave.net> <20140207034450.GB3787@in.ibm.com> <20140207142229.GA3081@irqsave.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20140207142229.GA3081@irqsave.net> Subject: Re: [Qemu-devel] [PATCH 1/2] block: gluster - code movements, state storage changes Reply-To: bharata@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?Beno=EEt?= Canet Cc: kwolf@redhat.com, Jeff Cody , qemu-devel@nongnu.org, stefanha@redhat.com On Fri, Feb 07, 2014 at 03:22:29PM +0100, Benoît Canet wrote: > Le Friday 07 Feb 2014 à 09:14:50 (+0530), Bharata B Rao a écrit : > > On Wed, Feb 05, 2014 at 08:25:36PM +0100, Benoît Canet wrote: > > > Le Tuesday 04 Feb 2014 à 14:26:58 (-0500), Jeff Cody a écrit : > > > > > > > > +static void qemu_gluster_parse_flags(int bdrv_flags, int *open_flags) > > > > +{ > > > > + assert(open_flags != NULL); > > > > + > > > > + *open_flags |= O_BINARY; > > > > + > > > > + if (bdrv_flags & BDRV_O_RDWR) { > > > > + *open_flags |= O_RDWR; > > > > + } else { > > > > + *open_flags |= O_RDONLY; > > > > + } > > > > + > > > > + if ((bdrv_flags & BDRV_O_NOCACHE)) { > > > > + *open_flags |= O_DIRECT; > > > > + } > > > > +} > > > > > > I saw the enable-O_SYNC option here. > > > http://www.gluster.org/community/documentation/index.php/Translators/performance > > > Why the gluster driver does not allow to enable O_SYNC ? > > > > I am not aware of any option in QEMU (like cache= etc) that will force > > block driver (like gluster) to use O_SYNC. Do other drivers use O_SYNC ? > > [,cache=writethrough|writeback|none|directsync|unsafe][ > > I think writethough is O_SYNC and directsync is O_DIRECT|O_SYNC. May be I am missing something, but I checked the flags with which raw protocol driver opens the file image for different cache options and this is what I found by looking at open flags in util/osdep.c:qemu_open() (Ignoring O_CLOEXEC which is common for all the cases) writethrough 02 O_RDWR writeback 02 O_RDWR none 040002 O_DIRECT|O_RDWR directsync 040002 O_DIRECT|O_RDWR unsafe 02 O_RDWR I do see the below comment in block/raw-posix.c:raw_parse_flags() /* Use O_DSYNC for write-through caching, no flags for write-back caching, * and O_DIRECT for no caching. */ if ((bdrv_flags & BDRV_O_NOCACHE)) { *open_flags |= O_DIRECT; } But I don't see the driver actually setting O_DSYNC anywhere. Regards, Bharata.