All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kani, Toshimitsu" <toshi.kani-ZPxbGqLxI0U@public.gmane.org>
To: "dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org"
	<dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org"
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Cc: "mawilcox-0li6OtcxBFHby3iVrkZq2A@public.gmane.org"
	<mawilcox-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>,
	"linux-nvdimm-y27Ovi1pjclAfugRpC6u6w@public.gmane.org"
	<linux-nvdimm-y27Ovi1pjclAfugRpC6u6w@public.gmane.org>,
	"nilesh.choudhury-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org"
	<nilesh.choudhury-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org"
	<linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>,
	"kirill.shutemov-VuQAYsv1563Yd54FQh9/CA@public.gmane.org"
	<kirill.shutemov-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	"kai.ka.zhang-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org"
	<kai.ka.zhang-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 4/5] mm: fix cache mode of dax pmd mappings
Date: Wed, 7 Sep 2016 19:39:19 +0000	[thread overview]
Message-ID: <1473277101.2092.39.camel@hpe.com> (raw)
In-Reply-To: <CAPcyv4hjdPWxdY+UTKVstiLZ7r4oOCa+h+Hd+kzS+wJZidzCjA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Tue, 2016-09-06 at 14:52 -0700, Dan Williams wrote:
> On Tue, Sep 6, 2016 at 1:17 PM, Andrew Morton <akpm@linux-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@linux.intel.com>
> > > Cc: Matthew Wilcox <mawilcox@microsoft.com>
> > > Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> > > Cc: Andrew Morton <akpm@linux-foundation.org>
> > > Cc: Nilesh Choudhury <nilesh.choudhury@oracle.com>
> > > Reported-by: Kai Zhang <kai.ka.zhang@oracle.com>
> > > Reported-by: Toshi Kani <toshi.kani@hpe.com>
> > > Cc: <stable@vger.kernel.org>
> > > Signed-off-by: Dan Williams <dan.j.williams@intel.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.

Thanks,
-Toshi
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

WARNING: multiple messages have this Message-ID (diff)
From: "Kani, Toshimitsu" <toshi.kani@hpe.com>
To: "dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kirill.shutemov@linux.intel.com"
	<kirill.shutemov@linux.intel.com>,
	"linux-nvdimm@ml01.01.org" <linux-nvdimm@ml01.01.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"mawilcox@microsoft.com" <mawilcox@microsoft.com>,
	"kai.ka.zhang@oracle.com" <kai.ka.zhang@oracle.com>,
	"nilesh.choudhury@oracle.com" <nilesh.choudhury@oracle.com>,
	"ross.zwisler@linux.intel.com" <ross.zwisler@linux.intel.com>
Subject: Re: [PATCH 4/5] mm: fix cache mode of dax pmd mappings
Date: Wed, 7 Sep 2016 19:39:19 +0000	[thread overview]
Message-ID: <1473277101.2092.39.camel@hpe.com> (raw)
In-Reply-To: <CAPcyv4hjdPWxdY+UTKVstiLZ7r4oOCa+h+Hd+kzS+wJZidzCjA@mail.gmail.com>

On Tue, 2016-09-06 at 14:52 -0700, Dan Williams wrote:
> On Tue, Sep 6, 2016 at 1:17 PM, Andrew Morton <akpm@linux-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@linux.intel.com>
> > > Cc: Matthew Wilcox <mawilcox@microsoft.com>
> > > Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> > > Cc: Andrew Morton <akpm@linux-foundation.org>
> > > Cc: Nilesh Choudhury <nilesh.choudhury@oracle.com>
> > > Reported-by: Kai Zhang <kai.ka.zhang@oracle.com>
> > > Reported-by: Toshi Kani <toshi.kani@hpe.com>
> > > Cc: <stable@vger.kernel.org>
> > > Signed-off-by: Dan Williams <dan.j.williams@intel.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.

Thanks,
-Toshi

  parent reply	other threads:[~2016-09-07 19:39 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06 16:49 [PATCH 0/5] device-dax and huge-page dax fixes for 4.8-rc6 Dan Williams
2016-09-06 16:49 ` Dan Williams
2016-09-06 16:49 ` Dan Williams
2016-09-06 16:49 ` [PATCH 1/5] dax: fix mapping size check Dan Williams
2016-09-06 16:49   ` Dan Williams
2016-09-06 16:49   ` Dan Williams
2016-09-06 16:49 ` [PATCH 2/5] dax: fix offset to physical address translation Dan Williams
2016-09-06 16:49   ` Dan Williams
2016-09-06 16:49   ` Dan Williams
2016-09-06 16:49   ` Dan Williams
2016-09-10  1:00   ` Dan Williams
2016-09-10  1:00     ` Dan Williams
2016-09-10  1:00     ` Dan Williams
2016-09-06 16:49 ` [PATCH 3/5] mm: fix show_smap() for zone_device-pmd ranges Dan Williams
2016-09-06 16:49   ` Dan Williams
2016-09-06 16:49   ` Dan Williams
2016-09-06 20:16   ` Andrew Morton
2016-09-06 20:16     ` Andrew Morton
2016-09-06 16:49 ` [PATCH 4/5] mm: fix cache mode of dax pmd mappings Dan Williams
2016-09-06 16:49   ` Dan Williams
2016-09-06 16:49   ` Dan Williams
2016-09-06 16:49   ` Dan Williams
2016-09-06 17:20   ` Matthew Wilcox
2016-09-06 17:20     ` Matthew Wilcox
2016-09-06 17:32     ` Dan Williams
2016-09-06 17:32       ` Dan Williams
2016-09-06 17:32       ` Dan Williams
     [not found]   ` <147318058165.30325.16762406881120129093.stgit-p8uTFz9XbKj2zm6wflaqv1nYeNYlB/vhral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-09-06 20:17     ` Andrew Morton
2016-09-06 20:17       ` Andrew Morton
2016-09-06 20:17       ` Andrew Morton
     [not found]       ` <20160906131756.6b6c6315b7dfba3a9d5f233a-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2016-09-06 21:52         ` Dan Williams
2016-09-06 21:52           ` Dan Williams
2016-09-06 21:52           ` Dan Williams
     [not found]           ` <CAPcyv4hjdPWxdY+UTKVstiLZ7r4oOCa+h+Hd+kzS+wJZidzCjA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-07 19:39             ` Kani, Toshimitsu [this message]
2016-09-07 19:39               ` Kani, Toshimitsu
     [not found]               ` <1473277101.2092.39.camel-ZPxbGqLxI0U@public.gmane.org>
2016-09-07 19:45                 ` Dan Williams
2016-09-07 19:45                   ` Dan Williams
2016-09-07 19:45                   ` Dan Williams
2016-09-06 16:49 ` [PATCH 5/5] mm: cleanup pfn_t usage in track_pfn_insert() Dan Williams
2016-09-06 16:49   ` Dan Williams
2016-09-06 16:49   ` Dan Williams
     [not found]   ` <147318058712.30325.12749411762275637099.stgit-p8uTFz9XbKj2zm6wflaqv1nYeNYlB/vhral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-09-06 20:20     ` Andrew Morton
2016-09-06 20:20       ` Andrew Morton
2016-09-06 20:20       ` Andrew Morton
     [not found]       ` <20160906132001.cd465767fa9844ddeb630cc4-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2016-09-06 20:30         ` Dan Williams
2016-09-06 20:30           ` Dan Williams
2016-09-06 20:30           ` Dan Williams
2016-09-07  5:12   ` Anshuman Khandual
2016-09-07  5:12     ` Anshuman Khandual
2016-09-07  5:12     ` Anshuman Khandual
2016-09-07 15:47     ` Dan Williams
2016-09-07 15:47       ` Dan Williams
2016-09-07 15:47       ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1473277101.2092.39.camel@hpe.com \
    --to=toshi.kani-zpxbgqlxi0u@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=kai.ka.zhang-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=kirill.shutemov-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=linux-nvdimm-y27Ovi1pjclAfugRpC6u6w@public.gmane.org \
    --cc=mawilcox-0li6OtcxBFHby3iVrkZq2A@public.gmane.org \
    --cc=nilesh.choudhury-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.