qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] block: gluster - code movements, state stor


From: Benoît Canet
Subject: Re: [Qemu-devel] [PATCH 1/2] block: gluster - code movements, state storage changes
Date: Mon, 10 Feb 2014 18:49:11 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Le Friday 07 Feb 2014 à 10:57:33 (-0500), Jeff Cody a écrit :
> On Fri, Feb 07, 2014 at 08:57:35PM +0530, Bharata B Rao wrote:
> > 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.
> >
> 
> You are not mistaken.  For qemu writethrough cache (the default), it
> is not via O_SYNC/DSYNC directly in the protocol drivers, but
> essentially done inside block.c (e.g., bdrv_flush()).
> 
> 

Hmm sorry for spreading fud. It was not intentional.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]