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


Groups > linux.kernel > #1497532

[PATCH v5 04/17] ext2: remove support for DAX PMD faults

From Ross Zwisler <ross.zwisler@linux.intel.com>
Newsgroups linux.kernel
Subject [PATCH v5 04/17] ext2: remove support for DAX PMD faults
Date 2016-10-07 23:20 +0200
Message-ID <spKIF-69y-1@gated-at.bofh.it> (permalink)
References <spKyZ-65z-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


DAX PMD support was added via the following commit:

commit e7b1ea2ad658 ("ext2: huge page fault support")

I believe this path to be untested as ext2 doesn't reliably provide block
allocations that are aligned to 2MiB.  In my testing I've been unable to
get ext2 to actually fault in a PMD.  It always fails with a "pfn
unaligned" message because the sector returned by ext2_get_block() isn't
aligned.

I've tried various settings for the "stride" and "stripe_width" extended
options to mkfs.ext2, without any luck.

Since we can't reliably get PMDs, remove support so that we don't have an
untested code path that we may someday traverse when we happen to get an
aligned block allocation.  This should also make 4k DAX faults in ext2 a
bit faster since they will no longer have to call the PMD fault handler
only to get a response of VM_FAULT_FALLBACK.

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
---
 fs/ext2/file.c | 29 ++++++-----------------------
 1 file changed, 6 insertions(+), 23 deletions(-)

diff --git a/fs/ext2/file.c b/fs/ext2/file.c
index 0ca363d..0f257f8 100644
--- a/fs/ext2/file.c
+++ b/fs/ext2/file.c
@@ -107,27 +107,6 @@ static int ext2_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 	return ret;
 }
 
-static int ext2_dax_pmd_fault(struct vm_area_struct *vma, unsigned long addr,
-						pmd_t *pmd, unsigned int flags)
-{
-	struct inode *inode = file_inode(vma->vm_file);
-	struct ext2_inode_info *ei = EXT2_I(inode);
-	int ret;
-
-	if (flags & FAULT_FLAG_WRITE) {
-		sb_start_pagefault(inode->i_sb);
-		file_update_time(vma->vm_file);
-	}
-	down_read(&ei->dax_sem);
-
-	ret = dax_pmd_fault(vma, addr, pmd, flags, ext2_get_block);
-
-	up_read(&ei->dax_sem);
-	if (flags & FAULT_FLAG_WRITE)
-		sb_end_pagefault(inode->i_sb);
-	return ret;
-}
-
 static int ext2_dax_pfn_mkwrite(struct vm_area_struct *vma,
 		struct vm_fault *vmf)
 {
@@ -154,7 +133,11 @@ static int ext2_dax_pfn_mkwrite(struct vm_area_struct *vma,
 
 static const struct vm_operations_struct ext2_dax_vm_ops = {
 	.fault		= ext2_dax_fault,
-	.pmd_fault	= ext2_dax_pmd_fault,
+	/*
+	 * .pmd_fault is not supported for DAX because allocation in ext2
+	 * cannot be reliably aligned to huge page sizes and so pmd faults
+	 * will always fail and fail back to regular faults.
+	 */
 	.page_mkwrite	= ext2_dax_fault,
 	.pfn_mkwrite	= ext2_dax_pfn_mkwrite,
 };
@@ -166,7 +149,7 @@ static int ext2_file_mmap(struct file *file, struct vm_area_struct *vma)
 
 	file_accessed(file);
 	vma->vm_ops = &ext2_dax_vm_ops;
-	vma->vm_flags |= VM_MIXEDMAP | VM_HUGEPAGE;
+	vma->vm_flags |= VM_MIXEDMAP;
 	return 0;
 }
 #else
-- 
2.7.4

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


Thread

[PATCH v5 00/17] re-enable DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 23:10 +0200
  [PATCH v5 07/17] dax: remove the last BUG_ON() from fs/dax.c Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 23:10 +0200
    Re: [PATCH v5 07/17] dax: remove the last BUG_ON() from fs/dax.c Jan Kara <jack@suse.cz> - 2016-10-11 21:00 +0200
  [PATCH v5 04/17] ext2: remove support for DAX PMD faults Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 23:20 +0200
  [PATCH v5 01/17] ext4: allow DAX writeback for hole punch Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 23:20 +0200
  [PATCH v5 12/17] dax: add dax_iomap_sector() helper function Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 23:20 +0200
    Re: [PATCH v5 12/17] dax: add dax_iomap_sector() helper function Christoph Hellwig <hch@lst.de> - 2016-10-10 17:50 +0200
    Re: [PATCH v5 12/17] dax: add dax_iomap_sector() helper function Jan Kara <jack@suse.cz> - 2016-10-11 20:50 +0200
  [PATCH v5 13/17] dax: dax_iomap_fault() needs to call iomap_end() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 23:20 +0200
    Re: [PATCH v5 13/17] dax: dax_iomap_fault() needs to call         iomap_end() Christoph Hellwig <hch@lst.de> - 2016-10-10 18:00 +0200
      Re: [PATCH v5 13/17] dax: dax_iomap_fault() needs to call iomap_end() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-11 00:10 +0200
    Re: [PATCH v5 13/17] dax: dax_iomap_fault() needs to call iomap_end() Jan Kara <jack@suse.cz> - 2016-10-11 20:50 +0200
  [PATCH v5 16/17] xfs: use struct iomap based DAX PMD fault path Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 23:20 +0200
    Re: [PATCH v5 16/17] xfs: use struct iomap based DAX PMD fault path Jan Kara <jack@suse.cz> - 2016-10-11 20:50 +0200
  [PATCH v5 08/17] dax: consistent variable naming for DAX entries Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 23:20 +0200
  [PATCH v5 05/17] ext2: return -EIO on ext2_iomap_end() failure Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 23:20 +0200
    Re: [PATCH v5 05/17] ext2: return -EIO on ext2_iomap_end() failure Jan Kara <jack@suse.cz> - 2016-10-11 21:00 +0200
  [PATCH v5 03/17] dax: remove buffer_size_valid() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 23:20 +0200
  [PATCH v5 09/17] dax: coordinate locking for offsets in PMD range Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 23:20 +0200
    Re: [PATCH v5 09/17] dax: coordinate locking for offsets in PMD         range Christoph Hellwig <hch@lst.de> - 2016-10-10 17:50 +0200
    Re: [PATCH v5 09/17] dax: coordinate locking for offsets in PMD range Jan Kara <jack@suse.cz> - 2016-10-11 20:50 +0200
      Re: [PATCH v5 09/17] dax: coordinate locking for offsets in PMD range Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-11 23:20 +0200
  [PATCH v5 02/17] ext4: tell DAX the size of allocation holes Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 23:20 +0200
  [PATCH v5 11/17] dax: correct dax iomap code namespace Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 23:20 +0200
    Re: [PATCH v5 11/17] dax: correct dax iomap code namespace Christoph Hellwig <hch@lst.de> - 2016-10-09 17:30 +0200
      [PATCH] dax: correct dax iomap code namespace Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-10 21:10 +0200
        Re: [PATCH] dax: correct dax iomap code namespace Dave Chinner <david@fromorbit.com> - 2016-10-10 22:50 +0200
  [PATCH v5 17/17] dax: remove "depends on BROKEN" from FS_DAX_PMD Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 23:20 +0200
  [PATCH v5 14/17] dax: move RADIX_DAX_* defines to dax.h Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 23:20 +0200
    Re: [PATCH v5 14/17] dax: move RADIX_DAX_* defines to dax.h Christoph Hellwig <hch@lst.de> - 2016-10-10 18:00 +0200
    Re: [PATCH v5 14/17] dax: move RADIX_DAX_* defines to dax.h Jan Kara <jack@suse.cz> - 2016-10-11 20:50 +0200
  [PATCH v5 10/17] dax: remove dax_pmd_fault() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 23:20 +0200
  [PATCH v5 15/17] dax: add struct iomap based DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 23:20 +0200
    Re: [PATCH v5 15/17] dax: add struct iomap based DAX PMD support Christoph Hellwig <hch@lst.de> - 2016-10-10 18:00 +0200
      Re: [PATCH v5 15/17] dax: add struct iomap based DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-11 00:10 +0200
      Re: [PATCH v5 15/17] dax: add struct iomap based DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-11 23:50 +0200
    Re: [PATCH v5 15/17] dax: add struct iomap based DAX PMD support Jan Kara <jack@suse.cz> - 2016-10-11 21:00 +0200
      Re: [PATCH v5 15/17] dax: add struct iomap based DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-12 01:00 +0200
        Re: [PATCH v5 15/17] dax: add struct iomap based DAX PMD support Jan Kara <jack@suse.cz> - 2016-10-12 09:50 +0200

csiph-web