From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com ([192.55.52.120]:36284 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932953AbcA0Rr3 (ORCPT ); Wed, 27 Jan 2016 12:47:29 -0500 Date: Wed, 27 Jan 2016 10:47:24 -0700 From: Ross Zwisler 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: <20160127174724.GA17879@linux.intel.com> 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, Jan 26, 2016 at 11:08:27PM -0500, 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 > --- > Documentation/filesystems/dax.txt | 12 +++-- > fs/block_dev.c | 10 +--- > fs/dax.c | 97 +++++++++++++-------------------------- > fs/ext2/file.c | 27 ++--------- > fs/ext4/file.c | 56 +++++++--------------- > fs/xfs/xfs_file.c | 25 +++++----- > fs/xfs/xfs_trace.h | 2 +- > include/linux/dax.h | 17 ------- > include/linux/mm.h | 20 ++++++-- > mm/memory.c | 20 ++++++-- > 10 files changed, 102 insertions(+), 184 deletions(-) > > diff --git a/Documentation/filesystems/dax.txt b/Documentation/filesystems/dax.txt > index 7bde640..2fe9e74 100644 > --- a/Documentation/filesystems/dax.txt > +++ b/Documentation/filesystems/dax.txt > @@ -49,6 +49,7 @@ These block devices may be used for inspiration: > - axonram: Axon DDR2 device driver > - brd: RAM backed block device driver > - dcssblk: s390 dcss block device driver > +- pmem: NV-DIMM Persistent Memory driver > > > Implementation Tips for Filesystem Writers > @@ -61,9 +62,9 @@ Filesystem support consists of > dax_do_io() instead of blockdev_direct_IO() if S_DAX is set > - implementing an mmap file operation for DAX files which sets the > VM_MIXEDMAP and VM_HUGEPAGE flags on the VMA, and setting the vm_ops to > - include handlers for fault, pmd_fault and page_mkwrite (which should > - probably call dax_fault(), dax_pmd_fault() and dax_mkwrite(), passing the > - appropriate get_block() callback) > + include handlers for fault, huge_fault and page_mkwrite (which should > + probably call dax_fault() and dax_mkwrite(), passing the appropriate > + get_block() callback) You might also want to mention that filesystems need to add a handler for dax_pfn_mkwrite(), which is now necessary so that we can properly track dirty radix tree entries due to the DAX fsync/msync changes. I also noticed that there is still a mention of __dax_fault() in the comment block in dax_pfn_mkwrite(), which should probably just s/__dax_fault()/dax_fault()/. Otherwise this looks great - thanks for getting rid of the dead wrappers! Reviewed-by: Ross Zwisler