linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Toshi Kani <toshi.kani@hp.com>
To: "Luis R. Rodriguez" <mcgrof@suse.com>
Cc: bp@alien8.de, hpa@zytor.com, tglx@linutronix.de,
	mingo@redhat.com, akpm@linux-foundation.org, arnd@arndb.de,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org, x86@kernel.org,
	linux-nvdimm@ml01.01.org, jgross@suse.com,
	stefan.bader@canonical.com, luto@amacapital.net, hmh@hmh.eng.br,
	yigal@plexistor.com, konrad.wilk@oracle.com, Elliott@hp.com,
	hch@lst.de
Subject: Re: [PATCH v12 0/10] Support Write-Through mapping on x86
Date: Tue, 02 Jun 2015 12:46:48 -0600	[thread overview]
Message-ID: <1433270808.23540.155.camel@misato.fc.hp.com> (raw)
In-Reply-To: <20150602162103.GL23057@wotan.suse.de>

On Tue, 2015-06-02 at 18:21 +0200, Luis R. Rodriguez wrote:
> On Mon, Jun 01, 2015 at 01:36:23PM -0600, Toshi Kani wrote:
> > This patchset adds support of Write-Through (WT) mapping on x86.
> > The study below shows that using WT mapping may be useful for
> > non-volatile memory.
> > 
> > http://www.hpl.hp.com/techreports/2012/HPL-2012-236.pdf
> > 
> > The patchset consists of the following changes.
> >  - Patch 1/10 to 6/10 add ioremap_wt()
> >  - Patch 7/10 adds pgprot_writethrough()
> >  - Patch 8/10 to 9/10 add set_memory_wt()
> >  - Patch 10/10 changes the pmem driver to call ioremap_wt()
> > 
> > All new/modified interfaces have been tested.
> > 
> > The patchset is based on:
> > git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git#tip-mm-2
> 
> While at it can you also look at:
>
> mcgrof@ergon ~/linux-next (git::master)$ git grep -4 "writethrough" drivers/infiniband/

Thanks for checking this.  The inifiniband driver uses WT mappings on
powerpc without proper WT interfaces defined.  They can be cleaned up by
a separate patch series to support WT on powerpc in the same way after
this patchset (support WT on x86) is settled.

> drivers/infiniband/hw/ipath/ipath_driver.c-
> drivers/infiniband/hw/ipath/ipath_driver.c-     dd->ipath_pcirev = pdev->revision;
> drivers/infiniband/hw/ipath/ipath_driver.c-
> drivers/infiniband/hw/ipath/ipath_driver.c-#if defined(__powerpc__)
> drivers/infiniband/hw/ipath/ipath_driver.c:     /* There isn't a generic way to specify writethrough mappings */
> drivers/infiniband/hw/ipath/ipath_driver.c-     dd->ipath_kregbase = __ioremap(addr, len,
> drivers/infiniband/hw/ipath/ipath_driver.c-             (_PAGE_NO_CACHE|_PAGE_WRITETHRU));
> drivers/infiniband/hw/ipath/ipath_driver.c-#else
> drivers/infiniband/hw/ipath/ipath_driver.c-     dd->ipath_kregbase = ioremap_nocache(addr, len);

Once powerpc defines ioremap_wt(), this driver can simply call
ioremap_wt() without the ifdef.  ioremap_wt() is defined as
ioremap_nocache() on the architectures without WT support.

> drivers/infiniband/hw/ipath/ipath_file_ops.c-
> drivers/infiniband/hw/ipath/ipath_file_ops.c-   phys = dd->ipath_physaddr + piobufs;
> drivers/infiniband/hw/ipath/ipath_file_ops.c-
> drivers/infiniband/hw/ipath/ipath_file_ops.c-#if defined(__powerpc__)
> drivers/infiniband/hw/ipath/ipath_file_ops.c:   /* There isn't a generic way to specify writethrough mappings */
> drivers/infiniband/hw/ipath/ipath_file_ops.c-   pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE;
> drivers/infiniband/hw/ipath/ipath_file_ops.c-   pgprot_val(vma->vm_page_prot) |= _PAGE_WRITETHRU;
> drivers/infiniband/hw/ipath/ipath_file_ops.c-   pgprot_val(vma->vm_page_prot) &= ~_PAGE_GUARDED;
> drivers/infiniband/hw/ipath/ipath_file_ops.c-#endif

Once powerpc defines pgprot_writethrough(), this driver can use it
without the ifdef.  pgprot_writethrough() is defined as
pgprot_noncached() on the architectures without WT support.

> drivers/infiniband/hw/qib/qib_file_ops.c-
> drivers/infiniband/hw/qib/qib_file_ops.c-       phys = dd->physaddr + piobufs;
> drivers/infiniband/hw/qib/qib_file_ops.c-
> drivers/infiniband/hw/qib/qib_file_ops.c-#if defined(__powerpc__)
> drivers/infiniband/hw/qib/qib_file_ops.c:       /* There isn't a generic way to specify writethrough mappings */
> drivers/infiniband/hw/qib/qib_file_ops.c-       pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE;
> drivers/infiniband/hw/qib/qib_file_ops.c-       pgprot_val(vma->vm_page_prot) |= _PAGE_WRITETHRU;
> drivers/infiniband/hw/qib/qib_file_ops.c-       pgprot_val(vma->vm_page_prot) &= ~_PAGE_GUARDED;
> drivers/infiniband/hw/qib/qib_file_ops.c-#endif

Same as above.

> drivers/infiniband/hw/qib/qib_pcie.c-   addr = pci_resource_start(pdev, 0);
> drivers/infiniband/hw/qib/qib_pcie.c-   len = pci_resource_len(pdev, 0);
> drivers/infiniband/hw/qib/qib_pcie.c-
> drivers/infiniband/hw/qib/qib_pcie.c-#if defined(__powerpc__)
> drivers/infiniband/hw/qib/qib_pcie.c:   /* There isn't a generic way to specify writethrough mappings */
> drivers/infiniband/hw/qib/qib_pcie.c-   dd->kregbase = __ioremap(addr, len, _PAGE_NO_CACHE | _PAGE_WRITETHRU);
> drivers/infiniband/hw/qib/qib_pcie.c-#else
> drivers/infiniband/hw/qib/qib_pcie.c-   dd->kregbase = ioremap_nocache(addr, len);
> drivers/infiniband/hw/qib/qib_pcie.c-#endif

Same as ipath_driver.c.

Thanks,
-Toshi


  reply	other threads:[~2015-06-02 19:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 19:36 [PATCH v12 0/10] Support Write-Through mapping on x86 Toshi Kani
2015-06-01 19:36 ` [PATCH v12 1/10] x86, mm, pat: Set WT to PA7 slot of PAT MSR Toshi Kani
2015-06-01 19:36 ` [PATCH v12 2/10] x86, mm, pat: Change reserve_memtype() for WT Toshi Kani
2015-06-01 19:36 ` [PATCH v12 3/10] x86, asm: Change is_new_memtype_allowed() " Toshi Kani
2015-06-01 19:36 ` [PATCH v12 4/10] x86, mm, asm-gen: Add ioremap_wt() " Toshi Kani
2015-06-01 19:36 ` [PATCH v12 5/10] arch/*/asm/io.h: Add ioremap_wt() to all architectures Toshi Kani
2015-06-01 19:36 ` [PATCH v12 6/10] video/fbdev, asm/io.h: Remove ioremap_writethrough() Toshi Kani
2015-06-02  7:06   ` Geert Uytterhoeven
2015-06-01 19:36 ` [PATCH v12 7/10] x86, mm, pat: Add pgprot_writethrough() for WT Toshi Kani
2015-06-01 19:36 ` [PATCH v12 08/10] x86, mm, asm: Add WT support to set_page_memtype() Toshi Kani
2015-06-01 19:36 ` [PATCH v12 09/10] x86, mm: Add set_memory_wt() for WT Toshi Kani
2015-06-01 19:36 ` [PATCH v12 10/10] drivers/block/pmem: Map NVDIMM with ioremap_wt() Toshi Kani
2015-06-02 16:21 ` [PATCH v12 0/10] Support Write-Through mapping on x86 Luis R. Rodriguez
2015-06-02 18:46   ` Toshi Kani [this message]
2015-06-02 19:43     ` Luis R. Rodriguez
2015-06-02 19:50       ` Andy Lutomirski
2015-06-02 20:01         ` Luis R. Rodriguez

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=1433270808.23540.155.camel@misato.fc.hp.com \
    --to=toshi.kani@hp.com \
    --cc=Elliott@hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=hch@lst.de \
    --cc=hmh@hmh.eng.br \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nvdimm@ml01.01.org \
    --cc=luto@amacapital.net \
    --cc=mcgrof@suse.com \
    --cc=mingo@redhat.com \
    --cc=stefan.bader@canonical.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yigal@plexistor.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).