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


Groups > linux.kernel > #1668037

Re: [PATCH v2 3/3] dax: use common 4k zero page for dax mmap reads

From Ross Zwisler <ross.zwisler@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 3/3] dax: use common 4k zero page for dax mmap reads
Date 2017-06-16 21:50 +0200
Message-ID <tT5pM-4AB-17@gated-at.bofh.it> (permalink)
References <tSkhb-85J-7@gated-at.bofh.it> <tSkhd-85J-35@gated-at.bofh.it> <tSEpA-3Kz-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Jun 15, 2017 at 04:58:56PM +0200, Jan Kara wrote:
> On Wed 14-06-17 11:22:11, Ross Zwisler wrote:
> > @@ -216,17 +217,6 @@ static void dax_unlock_mapping_entry(struct address_space *mapping,
> >  	dax_wake_mapping_entry_waiter(mapping, index, entry, false);
> >  }
> >  
> > -static void put_locked_mapping_entry(struct address_space *mapping,
> > -				     pgoff_t index, void *entry)
> > -{
> > -	if (!radix_tree_exceptional_entry(entry)) {
> > -		unlock_page(entry);
> > -		put_page(entry);
> > -	} else {
> > -		dax_unlock_mapping_entry(mapping, index);
> > -	}
> > -}
> > -
> 
> The naming becomes asymetric with this. So I'd prefer keeping
> put_locked_mapping_entry() as a trivial wrapper around
> dax_unlock_mapping_entry() unless we can craft more sensible naming / API
> for entry grabbing (and that would be a separate patch anyway).

Sure, that works for me.  I'll fix for v3.

> > -static int dax_load_hole(struct address_space *mapping, void **entry,
> > +static int dax_load_hole(struct address_space *mapping, void *entry,
> >  			 struct vm_fault *vmf)
> >  {
> >  	struct inode *inode = mapping->host;
> > -	struct page *page;
> > -	int ret;
> > -
> > -	/* Hole page already exists? Return it...  */
> > -	if (!radix_tree_exceptional_entry(*entry)) {
> > -		page = *entry;
> > -		goto finish_fault;
> > -	}
> > +	unsigned long vaddr = vmf->address;
> > +	int ret = VM_FAULT_NOPAGE;
> > +	struct page *zero_page;
> > +	void *entry2;
> >  
> > -	/* This will replace locked radix tree entry with a hole page */
> > -	page = find_or_create_page(mapping, vmf->pgoff,
> > -				   vmf->gfp_mask | __GFP_ZERO);
> 
> With this gone, you can also remove the special DAX handling from
> mm/filemap.c: page_cache_tree_insert() and remove from dax.h
> dax_wake_mapping_entry_waiter(), dax_radix_locked_entry() and RADIX_DAX
> definitions. Yay! As a separate patch please.

Oh, yay!  :)  Sure, I'll have this patch for v3.

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


Thread

[PATCH v2 0/3] DAX common 4k zero page Ross Zwisler <ross.zwisler@linux.intel.com> - 2017-06-14 19:30 +0200
  [PATCH v2 2/3] dax: relocate dax_load_hole() Ross Zwisler <ross.zwisler@linux.intel.com> - 2017-06-14 19:30 +0200
  [PATCH v2 1/3] mm: add vm_insert_mixed_mkwrite() Ross Zwisler <ross.zwisler@linux.intel.com> - 2017-06-14 19:30 +0200
    Re: [PATCH v2 1/3] mm: add vm_insert_mixed_mkwrite() Jan Kara <jack@suse.cz> - 2017-06-15 16:50 +0200
      Re: [PATCH v2 1/3] mm: add vm_insert_mixed_mkwrite() Ross Zwisler <ross.zwisler@linux.intel.com> - 2017-06-16 21:50 +0200
      Re: [PATCH v2 1/3] mm: add vm_insert_mixed_mkwrite() Ross Zwisler <ross.zwisler@linux.intel.com> - 2017-06-17 06:10 +0200
  [PATCH v2 3/3] dax: use common 4k zero page for dax mmap reads Ross Zwisler <ross.zwisler@linux.intel.com> - 2017-06-14 19:30 +0200
    Re: [PATCH v2 3/3] dax: use common 4k zero page for dax mmap reads Jan Kara <jack@suse.cz> - 2017-06-15 17:00 +0200
      Re: [PATCH v2 3/3] dax: use common 4k zero page for dax mmap reads Ross Zwisler <ross.zwisler@linux.intel.com> - 2017-06-16 21:50 +0200

csiph-web