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


Groups > linux.kernel > #1282256

Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping

From Toshi Kani <toshi.kani@hpe.com>
Newsgroups linux.kernel
Subject Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping
Date 2015-12-02 19:40 +0100
Message-ID <qBktP-2ty-1@gated-at.bofh.it> (permalink)
References (2 earlier) <qB4p4-ui-17@gated-at.bofh.it> <qB6Ax-1Pr-1@gated-at.bofh.it> <qBiLp-1hG-39@gated-at.bofh.it> <qBjxL-1Sz-1@gated-at.bofh.it> <qBk0P-2jf-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 2015-12-02 at 10:06 -0800, Dan Williams wrote:
> On Wed, Dec 2, 2015 at 9:01 AM, Dan Williams <dan.j.williams@intel.com> wrote:
> > On Wed, Dec 2, 2015 at 9:43 AM, Toshi Kani <toshi.kani@hpe.com> wrote:
> > > Oh, I see.  I will setup the memmap array and run the tests again.
> > > 
> > > But, why does the PMD mapping depend on the memmap array?  We have 
> > > observed major performance improvement with PMD.  This feature should 
> > > always be enabled with DAX regardless of the option to allocate the memmap
> > > array.
> > > 
> > 
> > Several factors drove this decision, I'm open to considering
> > alternatives but here's the reasoning:
> > 
> > 1/ DAX pmd mappings caused crashes in the get_user_pages path leading
> > to commit e82c9ed41e8 "dax: disable pmd mappings".  The reason pte
> > mappings don't crash and instead trigger -EFAULT is due to the
> > _PAGE_SPECIAL pte bit.
> > 
> > 2/ To enable get_user_pages for DAX, in both the page and huge-page
> > case, we need a new pte bit _PAGE_DEVMAP.
> > 
> > 3/ Given the pte bits are hard to come I'm assuming we won't get two,
> > i.e. both _PAGE_DEVMAP and a new _PAGE_SPECIAL for pmds.  Even if we
> > could get a _PAGE_SPECIAL for pmds I'm not in favor of pursuing it.
> 
> Actually, Dave says they aren't that hard to come by for pmds, so we
> could go add _PMD_SPECIAL if we really wanted to support the limited
> page-less DAX-pmd case.
> 
> But I'm still of the opinion that we run away from the page-less case
> until it can be made a full class citizen with O_DIRECT for pfn
> support.

I may be missing something, but per vm_normal_page(), I think _PAGE_SPECIAL can
be substituted by the following check when we do not have the memmap.

	if ((vma->vm_flags & VM_PFNMAP) ||
	    ((vma->vm_flags & VM_MIXEDMAP) && (!pfn_valid(pfn)))) {

This is what I did in this patch for follow_trans_huge_pmd(), although I missed
the pfn_valid() check.

Thanks,
-Toshi
--
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 | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Dan Williams <dan.j.williams@intel.com> - 2015-11-30 23:10 +0100
  Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Toshi Kani <toshi.kani@hpe.com> - 2015-12-02 02:30 +0100
    Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Dan Williams <dan.j.williams@intel.com> - 2015-12-02 04:50 +0100
      Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Toshi Kani <toshi.kani@hpe.com> - 2015-12-02 17:50 +0100
        Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Dan Williams <dan.j.williams@intel.com> - 2015-12-02 18:40 +0100
          Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Dan Williams <dan.j.williams@intel.com> - 2015-12-02 19:10 +0100
            Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Toshi Kani <toshi.kani@hpe.com> - 2015-12-02 19:40 +0100
              Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Toshi Kani <toshi.kani@hpe.com> - 2015-12-02 20:10 +0100
                Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Toshi Kani <toshi.kani@hpe.com> - 2015-12-02 20:20 +0100
                Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Dan Williams <dan.j.williams@intel.com> - 2015-12-02 21:00 +0100
                Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Toshi Kani <toshi.kani@hpe.com> - 2015-12-02 21:50 +0100
                Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Dan Williams <dan.j.williams@intel.com> - 2015-12-02 22:00 +0100
                Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Toshi Kani <toshi.kani@hpe.com> - 2015-12-02 22:10 +0100
                Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Dan Williams <dan.j.williams@intel.com> - 2015-12-04 00:50 +0100
                Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Toshi Kani <toshi.kani@hpe.com> - 2015-12-04 17:10 +0100
                Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Dave Hansen <dave.hansen@intel.com> - 2015-12-02 23:10 +0100
                Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Dave Hansen <dave.hansen@intel.com> - 2015-12-02 23:10 +0100
                Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Dan Williams <dan.j.williams@intel.com> - 2015-12-02 23:10 +0100
              Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Dan Williams <dan.j.williams@intel.com> - 2015-12-02 20:10 +0100
        Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Toshi Kani <toshi.kani@hpe.com> - 2015-12-03 00:30 +0100
          Re: [PATCH] mm: Fix mmap MAP_POPULATE for DAX pmd mapping Dan Williams <dan.j.williams@intel.com> - 2015-12-03 00:40 +0100

csiph-web