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


Groups > linux.kernel > #1276661

Re: [PATCH] dax: Split pmd map when fallback on COW

From Dan Williams <dan.j.williams@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] dax: Split pmd map when fallback on COW
Date 2015-11-24 18:10 +0100
Message-ID <qypgn-2AY-27@gated-at.bofh.it> (permalink)
References <qy5KG-6GT-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Nov 23, 2015 at 12:05 PM, Toshi Kani <toshi.kani@hpe.com> wrote:
> An infinite loop of PMD faults was observed when attempted to
> mlock() a private read-only PMD mmap'd range of a DAX file.
>
> __dax_pmd_fault() simply returns with VM_FAULT_FALLBACK when
> falling back to PTE on COW.  However, __handle_mm_fault()
> returns without falling back to handle_pte_fault() because
> a PMD map is present in this case.
>
> Change __dax_pmd_fault() to split the PMD map, if present,
> before returning with VM_FAULT_FALLBACK.
>
> Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Matthew Wilcox <willy@linux.intel.com>
> Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
> ---
>  fs/dax.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fs/dax.c b/fs/dax.c
> index 43671b6..3405583 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -546,8 +546,10 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address,
>                 return VM_FAULT_FALLBACK;
>
>         /* Fall back to PTEs if we're going to COW */
> -       if (write && !(vma->vm_flags & VM_SHARED))
> +       if (write && !(vma->vm_flags & VM_SHARED)) {
> +               split_huge_page_pmd(vma, address, pmd);
>                 return VM_FAULT_FALLBACK;
> +       }

Reviewed-by: Dan Williams <dan.j.williams@intel.com>

I took a closer look at dax's CONFIG_TRANSPARENT_HUGEPAGE interactions
and it turns out THP is a performance enhancement not a functional
dependency.  I.e. a performance enhancement to use a huge_zero_page
where available, but not a requirement.

I'll fold this in with my series make pmd_trans_huge() return false
for non-huge_zero_page dax mappings, and in that case I'll need to
up-level the call to  pmdp_huge_clear_flush_notify() from
__split_huge_page_pmd.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH] dax: Split pmd map when fallback on COW Toshi Kani <toshi.kani@hpe.com> - 2015-11-23 21:20 +0100
  Re: [PATCH] dax: Split pmd map when fallback on COW Dan Williams <dan.j.williams@intel.com> - 2015-11-23 21:50 +0100
    Re: [PATCH] dax: Split pmd map when fallback on COW Toshi Kani <toshi.kani@hpe.com> - 2015-11-23 22:00 +0100
      Re: [PATCH] dax: Split pmd map when fallback on COW Dan Williams <dan.j.williams@intel.com> - 2015-11-23 22:00 +0100
        Re: [PATCH] dax: Split pmd map when fallback on COW Toshi Kani <toshi.kani@hpe.com> - 2015-11-23 22:10 +0100
  Re: [PATCH] dax: Split pmd map when fallback on COW Toshi Kani <toshi.kani@hpe.com> - 2015-11-24 00:10 +0100
  Re: [PATCH] dax: Split pmd map when fallback on COW Dan Williams <dan.j.williams@intel.com> - 2015-11-24 18:10 +0100

csiph-web