Re: [PATCH 1/2] mm,fs,dax: Change ->pmd_fault to ->huge_fault

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 26, 2016 at 11:08:27PM -0500, Matthew Wilcox wrote:
> From: Matthew Wilcox <willy@xxxxxxxxxxxxxxx>
> 
> 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 <willy@xxxxxxxxxxxxxxx>
> ---
>  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 <ross.zwisler@xxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux