Re: [PATCH 4/4] iomap: Use FUA for pure data O_DSYNC DIO writes

2018-05-01 Thread Dave Chinner
On Tue, Apr 24, 2018 at 10:34:44AM -0700, Christoph Hellwig wrote: > On Sat, Apr 21, 2018 at 02:54:05PM +0200, Jan Kara wrote: > > > - if (iocb->ki_flags & IOCB_DSYNC) > > > + if (iocb->ki_flags & IOCB_DSYNC) { > > > dio->flags |= IOMAP_DIO_NEED_SYNC; > > > +

Re: [PATCH 4/4] iomap: Use FUA for pure data O_DSYNC DIO writes

2018-04-25 Thread Jan Kara
On Wed 25-04-18 00:07:07, Holger Hoffstätte wrote: > On 04/24/18 19:34, Christoph Hellwig wrote: > > On Sat, Apr 21, 2018 at 02:54:05PM +0200, Jan Kara wrote: > > > > - if (iocb->ki_flags & IOCB_DSYNC) > > > > + if (iocb->ki_flags & IOCB_DSYNC) { > > > >

Re: [PATCH 4/4] iomap: Use FUA for pure data O_DSYNC DIO writes

2018-04-24 Thread Christoph Hellwig
On Wed, Apr 25, 2018 at 12:07:07AM +0200, Holger Hoffstätte wrote: > The above line just gives parenthesis salad errors, so why not compromise > on: > > if ((iocb->ki_flags & (IOCB_DSYNC | IOCB_SYNC)) == IOCB_DSYNC) { > > Unless my bit twiddling has completely left me I think this is what

Re: [PATCH 4/4] iomap: Use FUA for pure data O_DSYNC DIO writes

2018-04-24 Thread Holger Hoffstätte
On 04/24/18 19:34, Christoph Hellwig wrote: On Sat, Apr 21, 2018 at 02:54:05PM +0200, Jan Kara wrote: - if (iocb->ki_flags & IOCB_DSYNC) + if (iocb->ki_flags & IOCB_DSYNC) { dio->flags |= IOMAP_DIO_NEED_SYNC; + /* +

Re: [PATCH 4/4] iomap: Use FUA for pure data O_DSYNC DIO writes

2018-04-24 Thread Christoph Hellwig
On Sat, Apr 21, 2018 at 02:54:05PM +0200, Jan Kara wrote: > > - if (iocb->ki_flags & IOCB_DSYNC) > > + if (iocb->ki_flags & IOCB_DSYNC) { > > dio->flags |= IOMAP_DIO_NEED_SYNC; > > + /* > > +* We optimistically try using

Re: [PATCH 4/4] iomap: Use FUA for pure data O_DSYNC DIO writes

2018-04-21 Thread Jan Kara
On Wed 18-04-18 14:08:28, Dave Chinner wrote: > @@ -1012,8 +1035,16 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, > dio->flags |= IOMAP_DIO_DIRTY; > } else { > dio->flags |= IOMAP_DIO_WRITE; > - if (iocb->ki_flags & IOCB_DSYNC) > +

[PATCH 4/4] iomap: Use FUA for pure data O_DSYNC DIO writes

2018-04-17 Thread Dave Chinner
From: Dave Chinner If we are doing direct IO writes with datasync semantics, we often have to flush metadata changes along with the data write. However, if we are overwriting existing data, there are no metadata changes that we need to flush. In this case, optimising the IO