From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:60869 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965954AbcA1MRE (ORCPT ); Thu, 28 Jan 2016 07:17:04 -0500 Date: Thu, 28 Jan 2016 13:17:10 +0100 From: Jan Kara To: Matthew Wilcox Cc: Jan Kara , Dave Chinner , Ross Zwisler , Matthew Wilcox , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 1/2] mm,fs,dax: Change ->pmd_fault to ->huge_fault Message-ID: <20160128121710.GF7726@quack.suse.cz> References: <1453867708-3999-1-git-send-email-matthew.r.wilcox@intel.com> <1453867708-3999-2-git-send-email-matthew.r.wilcox@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1453867708-3999-2-git-send-email-matthew.r.wilcox@intel.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue 26-01-16 23:08:27, Matthew Wilcox wrote: > From: Matthew Wilcox > > In preparation for adding the ability to handle PUD pages, convert > ->pmd_fault to ->huge_fault. huge_fault() takes a vm_fault structure > instead of separate (address, pmd, flags) parameters. The vm_fault > structure is extended to include a union of the different page table > pointers that may be needed, and three flag bits are reserved to indicate > which type of pointer is in the union. > > The DAX fault handlers are unified into one entry point, meaning that > the filesystems can be largely unconcerned with what size of fault they > are handling. ext4 needs to know in order to reserve enough blocks in > the journal, but ext2 and xfs are oblivious. > > The existing dax_fault and dax_mkwrite had no callers, so rename the > __dax_fault and __dax_mkwrite to lose the initial underscores. > > Signed-off-by: Matthew Wilcox Thanks for these simplifications. I like them! Just one nit below: > diff --git a/mm/memory.c b/mm/memory.c > index a2eaeef..03d49eb 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -3274,10 +3274,16 @@ out: > static int create_huge_pmd(struct mm_struct *mm, struct vm_area_struct *vma, > unsigned long address, pmd_t *pmd, unsigned int flags) > { > + struct vm_fault vmf = { > + .virtual_address = (void __user *)address, > + .flags = flags | FAULT_FLAG_SIZE_PMD, > + .pmd = pmd, > + }; > + I think we should fill in also the vmf.gfp_mask and vmf.pgoff fields. I know they are not currently used but it would be a nasty surprise if someone tried to use them in the future... Otherwise feel free to add: Reviewed-by: Jan Kara Honza -- Jan Kara SUSE Labs, CR