linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ross Zwisler <ross.zwisler@linux.intel.com>
To: Jan Kara <jack@suse.cz>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>,
	linux-kernel@vger.kernel.org,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	Dan Williams <dan.j.williams@intel.com>,
	Dave Chinner <david@fromorbit.com>, Jan Kara <jack@suse.com>,
	Matthew Wilcox <willy@linux.intel.com>,
	linux-fsdevel@vger.kernel.org, linux-nvdimm@lists.01.org
Subject: Re: [PATCH v2 3/5] dax: improve documentation for fsync/msync
Date: Fri, 22 Jan 2016 08:58:28 -0700	[thread overview]
Message-ID: <20160122155828.GA22112@linux.intel.com> (raw)
In-Reply-To: <20160122150129.GL16898@quack.suse.cz>

On Fri, Jan 22, 2016 at 04:01:29PM +0100, Jan Kara wrote:
> On Thu 21-01-16 10:46:02, Ross Zwisler wrote:
> > Several of the subtleties and assumptions of the DAX fsync/msync
> > implementation are not immediately obvious, so document them with comments.
> > 
> > Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> > Reported-by: Jan Kara <jack@suse.cz>
> 
> Thanks, the comments really help! Just two nits below, otherwise feel free
> to add:
> 
> Reviewed-by: Jan Kara <jack@suse.cz>
> 
> > ---
> >  fs/dax.c | 30 ++++++++++++++++++++++++++++++
> >  1 file changed, 30 insertions(+)
> > 
> > diff --git a/fs/dax.c b/fs/dax.c
> > index d589113..55ae394 100644
> > --- a/fs/dax.c
> > +++ b/fs/dax.c
> > @@ -350,6 +350,13 @@ static int dax_radix_entry(struct address_space *mapping, pgoff_t index,
> >  
> >  		if (!pmd_entry || type == RADIX_DAX_PMD)
> >  			goto dirty;
> > +
> > +		/*
> > +		 * We only insert dirty PMD entries into the radix tree.  This
> > +		 * means we don't need to worry about removing a dirty PTE
> > +		 * entry and inserting a clean PMD entry, thus reducing the
> > +		 * range we would flush with a follow-up fsync/msync call.
> > +		 */
> 
> May be acompany this with:
> 
> 		WARN_ON(pmd_entry && !dirty);
> 
> somewhere in dax_radix_entry()?

Sure, I'll add one.

> >  		radix_tree_delete(&mapping->page_tree, index);
> >  		mapping->nrexceptional--;
> >  	}
> > @@ -912,6 +919,21 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address,
> >  		}
> >  		dax_unmap_atomic(bdev, &dax);
> >  
> > +		/*
> > +		 * For PTE faults we insert a radix tree entry for reads, and
> > +		 * leave it clean.  Then on the first write we dirty the radix
> > +		 * tree entry via the dax_pnf_mkwrite() path.  This sequence
> 					  ^^^ pfn

Thanks, will fix.

  reply	other threads:[~2016-01-22 15:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21 17:45 [PATCH v2 0/5] DAX fsync/msync fixes Ross Zwisler
2016-01-21 17:46 ` [PATCH v2 1/5] dax: never rely on bh.b_dev being set by get_block() Ross Zwisler
2016-01-22 14:53   ` Jan Kara
2016-01-21 17:46 ` [PATCH v2 2/5] dax: clear TOWRITE flag after flush is complete Ross Zwisler
2016-01-22 14:55   ` Jan Kara
2016-01-21 17:46 ` [PATCH v2 3/5] dax: improve documentation for fsync/msync Ross Zwisler
2016-01-22 15:01   ` Jan Kara
2016-01-22 15:58     ` Ross Zwisler [this message]
2016-01-22 16:17       ` Elliott, Robert (Persistent Memory)
2016-01-21 17:46 ` [PATCH v2 4/5] dax: fix PMD handling " Ross Zwisler
2016-01-22 15:11   ` Jan Kara
2016-01-22 16:01     ` Ross Zwisler
2016-01-21 17:46 ` [PATCH v2 5/5] dax: fix clearing of holes in __dax_pmd_fault() Ross Zwisler
2016-01-22 15:37   ` Jan Kara
2016-01-22 16:12     ` Ross Zwisler
2016-01-25 14:40       ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160122155828.GA22112@linux.intel.com \
    --to=ross.zwisler@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=david@fromorbit.com \
    --cc=jack@suse.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).