Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1217838

Re: [PATCH] dax, pmem: add support for msync

From "Kirill A. Shutemov" <kirill@shutemov.name>
Newsgroups linux.kernel
Subject Re: [PATCH] dax, pmem: add support for msync
Date 2015-09-02 22:20 +0200
Message-ID <q4mFH-773-11@gated-at.bofh.it> (permalink)
References <q3CCS-8jt-11@gated-at.bofh.it> <q3GQa-5Ns-7@gated-at.bofh.it> <q3NRD-7PA-7@gated-at.bofh.it> <q3SHD-6h9-1@gated-at.bofh.it> <q4lzY-5B5-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Sep 02, 2015 at 01:04:01PM -0600, Ross Zwisler wrote:
> On Tue, Sep 01, 2015 at 03:18:41PM +0300, Boaz Harrosh wrote:
> > So the approach we took was a bit different to exactly solve these
> > problem, and to also not over flush too much. here is what we did.
> > 
> > * At vm_operations_struct we also override the .close vector (say call it dax_vm_close)
> > 
> > * At dax_vm_close() on writable files call ->fsync(,vma->vm_start, vma->vm_end,)
> >   (We have an inode flag if the file was actually dirtied, but even if not, that will
> >    not be that bad, so a file was opened for write, mmapped, but actually never
> >    modified. Not a lot of these, and the do nothing cl_flushing is very fast)
> > 
> > * At ->fsync() do the actual cl_flush for all cases but only iff
> > 	if (mapping_mapped(inode->i_mapping) == 0)
> > 		return 0;
> > 
> >   This is because data written not through mmap is already persistent and we
> >   do not need the cl_flushing
> > 
> > Apps expect all these to work:
> > 1. open mmap m-write msync ... close
> > 2. open mmap m-write fsync ... close
> > 3. open mmap m-write unmap ... fsync close
> > 
> > 4. open mmap m-write sync ...
> 
> So basically you made close have an implicit fsync?  What about the flow that
> looks like this:
> 
> 5. open mmap close m-write
> 
> This guy definitely needs an msync/fsync at the end to make sure that the
> m-write becomes durable.  

We can sync on pte_dirty() during zap_page_range(): it's practically free,
since we page walk anyway.

With this approach it probably makes sense to come back to page walk on
msync() side too to be consistent wrt pte_dirty() meaning.

> Also, the CLOSE(2) man page specifically says that a flush does not occur at
> close:
> 	A successful close does not guarantee that the data has been
> 	successfully  saved  to  disk,  as  the  kernel defers  writes.   It
> 	is not common for a filesystem to flush the buffers when the stream is
> 	closed.  If you need to be sure that the data is physically stored,
> 	use fsync(2).  (It will depend on the disk  hardware  at this point.)
> 
> I don't think that adding an implicit fsync to close is the right solution -
> we just need to get msync and fsync correctly working.

I doesn't mean we can't sync if we can do without noticible performance
degradation.

-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] dax, pmem: add support for msync Ross Zwisler <ross.zwisler@linux.intel.com> - 2015-08-31 21:10 +0200
  Re: [PATCH] dax, pmem: add support for msync Christoph Hellwig <hch@lst.de> - 2015-08-31 21:10 +0200
    Re: [PATCH] dax, pmem: add support for msync Ross Zwisler <ross.zwisler@linux.intel.com> - 2015-08-31 21:30 +0200
      Re: [PATCH] dax, pmem: add support for msync Christoph Hellwig <hch@lst.de> - 2015-08-31 21:40 +0200
  Re: [PATCH] dax, pmem: add support for msync Dave Chinner <david@fromorbit.com> - 2015-09-01 01:40 +0200
    Re: [PATCH] dax, pmem: add support for msync Christoph Hellwig <hch@lst.de> - 2015-09-01 09:10 +0200
      Re: [PATCH] dax, pmem: add support for msync Boaz Harrosh <boaz@plexistor.com> - 2015-09-01 14:20 +0200
        Re: [PATCH] dax, pmem: add support for msync Ross Zwisler <ross.zwisler@linux.intel.com> - 2015-09-02 21:10 +0200
          Re: [PATCH] dax, pmem: add support for msync "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-09-02 22:20 +0200
          Re: [PATCH] dax, pmem: add support for msync Boaz Harrosh <boaz@plexistor.com> - 2015-09-03 08:40 +0200
            Re: [PATCH] dax, pmem: add support for msync Ross Zwisler <ross.zwisler@linux.intel.com> - 2015-09-03 18:50 +0200
      Re: [PATCH] dax, pmem: add support for msync Dave Chinner <david@fromorbit.com> - 2015-09-02 00:30 +0200
        Re: [PATCH] dax, pmem: add support for msync Ross Zwisler <ross.zwisler@linux.intel.com> - 2015-09-02 05:20 +0200
          Re: [PATCH] dax, pmem: add support for msync Dave Chinner <david@fromorbit.com> - 2015-09-02 07:20 +0200
            Re: [PATCH] dax, pmem: add support for msync Boaz Harrosh <boaz@plexistor.com> - 2015-09-02 12:30 +0200
              Re: [PATCH] dax, pmem: add support for msync Dave Hansen <dave.hansen@linux.intel.com> - 2015-09-02 16:30 +0200
                Re: [PATCH] dax, pmem: add support for msync Boaz Harrosh <boaz@plexistor.com> - 2015-09-02 17:20 +0200
                Re: [PATCH] dax, pmem: add support for msync Dave Hansen <dave.hansen@linux.intel.com> - 2015-09-02 17:50 +0200
                Re: [PATCH] dax, pmem: add support for msync Boaz Harrosh <boaz@plexistor.com> - 2015-09-02 18:10 +0200
                Re: [PATCH] dax, pmem: add support for msync Dave Hansen <dave.hansen@linux.intel.com> - 2015-09-02 18:20 +0200
                Re: [PATCH] dax, pmem: add support for msync Boaz Harrosh <boaz@plexistor.com> - 2015-09-03 08:50 +0200
          Re: [PATCH] dax, pmem: add support for msync Boaz Harrosh <boaz@plexistor.com> - 2015-09-02 12:10 +0200
    Re: [PATCH] dax, pmem: add support for msync "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-09-01 12:10 +0200
      Re: [PATCH] dax, pmem: add support for msync Boaz Harrosh <boaz@plexistor.com> - 2015-09-01 13:30 +0200
      Re: [PATCH] dax, pmem: add support for msync Dave Chinner <david@fromorbit.com> - 2015-09-02 00:50 +0200
        Re: [PATCH] dax, pmem: add support for msync "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-09-02 11:20 +0200
          Re: [PATCH] dax, pmem: add support for msync Boaz Harrosh <boaz@plexistor.com> - 2015-09-02 11:40 +0200
            Re: [PATCH] dax, pmem: add support for msync Boaz Harrosh <boaz@plexistor.com> - 2015-09-02 11:50 +0200
              Re: [PATCH] dax, pmem: add support for msync "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-09-02 11:50 +0200
                Re: [PATCH] dax, pmem: add support for msync Boaz Harrosh <boaz@plexistor.com> - 2015-09-02 12:30 +0200
          Re: [PATCH] dax, pmem: add support for msync Dave Chinner <david@fromorbit.com> - 2015-09-03 03:00 +0200
  Re: [PATCH] dax, pmem: add support for msync Boaz Harrosh <boaz@plexistor.com> - 2015-09-01 15:20 +0200
    Re: [PATCH] dax, pmem: add support for msync Ross Zwisler <ross.zwisler@linux.intel.com> - 2015-09-02 19:50 +0200

csiph-web