[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPcyv4hbBVYk=vqeiJ28LHZ8H3y9HiRwOhKEQY7D02jZA0goEA@mail.gmail.com>
Date: Wed, 7 Sep 2016 12:45:16 -0700
From: Dan Williams <dan.j.williams@...el.com>
To: "Kani, Toshimitsu" <toshi.kani@....com>
Cc: "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
"linux-nvdimm@...1.01.org" <linux-nvdimm@...1.01.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>,
"mawilcox@...rosoft.com" <mawilcox@...rosoft.com>,
"kai.ka.zhang@...cle.com" <kai.ka.zhang@...cle.com>,
"nilesh.choudhury@...cle.com" <nilesh.choudhury@...cle.com>,
"ross.zwisler@...ux.intel.com" <ross.zwisler@...ux.intel.com>
Subject: Re: [PATCH 4/5] mm: fix cache mode of dax pmd mappings
On Wed, Sep 7, 2016 at 12:39 PM, Kani, Toshimitsu <toshi.kani@....com> wrote:
> On Tue, 2016-09-06 at 14:52 -0700, Dan Williams wrote:
>> On Tue, Sep 6, 2016 at 1:17 PM, Andrew Morton <akpm@...ux-foundation.
>> org> wrote:
>> >
>> > On Tue, 06 Sep 2016 09:49:41 -0700 Dan Williams <dan.j.williams@int
>> > el.com> wrote:
>> >
>> > >
>> > > track_pfn_insert() is marking dax mappings as uncacheable.
>> > >
>> > > It is used to keep mappings attributes consistent across a
>> > > remapped range. However, since dax regions are never registered
>> > > via track_pfn_remap(), the caching mode lookup for dax pfns
>> > > always returns _PAGE_CACHE_MODE_UC. We do not use
>> > > track_pfn_insert() in the dax-pte path, and we always want to use
>> > > the pgprot of the vma itself, so drop this call.
>> > >
>> > > Cc: Ross Zwisler <ross.zwisler@...ux.intel.com>
>> > > Cc: Matthew Wilcox <mawilcox@...rosoft.com>
>> > > Cc: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
>> > > Cc: Andrew Morton <akpm@...ux-foundation.org>
>> > > Cc: Nilesh Choudhury <nilesh.choudhury@...cle.com>
>> > > Reported-by: Kai Zhang <kai.ka.zhang@...cle.com>
>> > > Reported-by: Toshi Kani <toshi.kani@....com>
>> > > Cc: <stable@...r.kernel.org>
>> > > Signed-off-by: Dan Williams <dan.j.williams@...el.com>
>> >
>> > Changelog fails to explain the user-visible effects of the
>> > patch. The stable maintainer(s) will look at this and wonder "ytf
>> > was I sent this".
>>
>> True, I'll change it to this:
>>
>> track_pfn_insert() is marking dax mappings as uncacheable rendering
>> them impractical for application usage. DAX-pte mappings are cached
>> and the goal of establishing DAX-pmd mappings is to attain more
>> performance, not dramatically less (3 orders of magnitude).
>>
>> Deleting the call to track_pfn_insert() in vmf_insert_pfn_pmd() lets
>> the default pgprot (write-back cache enabled) from the vma be used
>> for the mapping which yields the expected performance improvement
>> over DAX-pte mappings.
>>
>> track_pfn_insert() is meant to keep the cache mode for a given range
>> synchronized across different users of remap_pfn_range() and
>> vm_insert_pfn_prot(). DAX uses neither of those mapping methods, and
>> the pmem driver is already marking its memory ranges as write-back
>> cache enabled. So, removing the call to track_pfn_insert() leaves
>> the kernel no worse off than the current situation where a user could
>> map the range via /dev/mem with an incompatible cache mode compared
>> to the driver.
>
> I think devm_memremap_pages() should call reserve_memtype() on x86 to
> keep it consistent with devm_memremap() on this regard. We may need an
> arch stub for reserve_memtype(), though. Then, track_pfn_insert()
> should have no issue in this case.
Yes, indeed! In fact I already have that re-write getting 0day
coverage before posting. It occurred to me while re-writing the
changelog per Andrew's prompting.
Powered by blists - more mailing lists