From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
paulus@samba.org, mpe@ellerman.id.au
Cc: linux-rdma@vger.kernel.org,
Mike Marciniszyn <infinipath@intel.com>,
Doug Ledford <dledford@redhat.com>,
Sean Hefty <sean.hefty@intel.com>,
linuxppc-dev@lists.ozlabs.org,
Hal Rosenstock <hal.rosenstock@gmail.com>
Subject: Re: [PATCH V2] powerpc/infiniband: Use cache inhibitted and guarded mapping on powerpc
Date: Fri, 22 Apr 2016 08:47:56 +1000 [thread overview]
Message-ID: <1461278876.3135.18.camel@kernel.crashing.org> (raw)
In-Reply-To: <1461139097-10213-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
On Wed, 2016-04-20 at 03:58 -0400, Aneesh Kumar K.V wrote:
> The driver was requesting for a writethrough mapping. But with thoses
> flags we will end up with a SAO mapping because we now have memory
> conherence always enabled. ie, the existing mapping will end up with
> a WIMG value 0b1110 which is Strong Access Order.
>
> Update this to use cache inhibitted guarded mapping
Why guarded ? If it's performance sensitive (and the driver has
appropriate barriers where needed), you will get write combining
without guarded, you won't with it.
Cheers,
Ben.
> Cc: Mike Marciniszyn <infinipath@intel.com>
> Cc: Doug Ledford <dledford@redhat.com>
> Cc: Sean Hefty <sean.hefty@intel.com>
> Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
> Cc: linux-rdma@vger.kernel.org
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
> Changes from v1:
> * resend because V1 never reached mailing list.
>
> NOTE: This is only compile tested and I am also not sure why ppc64
> needs special handling.
> We need this patch because the series at http://mid.gmane.org/1460182
> 444-2468-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com
> will drop _PAGE_WRITETHRU
>
> drivers/infiniband/hw/qib/qib_file_ops.c | 5 +----
> drivers/infiniband/hw/qib/qib_pcie.c | 6 ------
> 2 files changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/drivers/infiniband/hw/qib/qib_file_ops.c
> b/drivers/infiniband/hw/qib/qib_file_ops.c
> index e449e394963f..a3d593f546ec 100644
> --- a/drivers/infiniband/hw/qib/qib_file_ops.c
> +++ b/drivers/infiniband/hw/qib/qib_file_ops.c
> @@ -822,10 +822,7 @@ static int mmap_piobufs(struct vm_area_struct
> *vma,
> phys = dd->physaddr + piobufs;
>
> #if defined(__powerpc__)
> - /* There isn't a generic way to specify writethrough
> mappings */
> - pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE;
> - pgprot_val(vma->vm_page_prot) |= _PAGE_WRITETHRU;
> - pgprot_val(vma->vm_page_prot) &= ~_PAGE_GUARDED;
> + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
> #endif
>
> /*
> diff --git a/drivers/infiniband/hw/qib/qib_pcie.c
> b/drivers/infiniband/hw/qib/qib_pcie.c
> index 4758a3801ae8..6abe1c621aa4 100644
> --- a/drivers/infiniband/hw/qib/qib_pcie.c
> +++ b/drivers/infiniband/hw/qib/qib_pcie.c
> @@ -144,13 +144,7 @@ int qib_pcie_ddinit(struct qib_devdata *dd,
> struct pci_dev *pdev,
> addr = pci_resource_start(pdev, 0);
> len = pci_resource_len(pdev, 0);
>
> -#if defined(__powerpc__)
> - /* There isn't a generic way to specify writethrough
> mappings */
> - dd->kregbase = __ioremap(addr, len, _PAGE_NO_CACHE |
> _PAGE_WRITETHRU);
> -#else
> dd->kregbase = ioremap_nocache(addr, len);
> -#endif
> -
> if (!dd->kregbase)
> return -ENOMEM;
>
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev
WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
paulus@samba.org, mpe@ellerman.id.au
Cc: linuxppc-dev@lists.ozlabs.org,
Mike Marciniszyn <infinipath@intel.com>,
Doug Ledford <dledford@redhat.com>,
Sean Hefty <sean.hefty@intel.com>,
Hal Rosenstock <hal.rosenstock@gmail.com>,
linux-rdma@vger.kernel.org
Subject: Re: [PATCH V2] powerpc/infiniband: Use cache inhibitted and guarded mapping on powerpc
Date: Fri, 22 Apr 2016 08:47:56 +1000 [thread overview]
Message-ID: <1461278876.3135.18.camel@kernel.crashing.org> (raw)
In-Reply-To: <1461139097-10213-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
On Wed, 2016-04-20 at 03:58 -0400, Aneesh Kumar K.V wrote:
> The driver was requesting for a writethrough mapping. But with thoses
> flags we will end up with a SAO mapping because we now have memory
> conherence always enabled. ie, the existing mapping will end up with
> a WIMG value 0b1110 which is Strong Access Order.
>
> Update this to use cache inhibitted guarded mapping
Why guarded ? If it's performance sensitive (and the driver has
appropriate barriers where needed), you will get write combining
without guarded, you won't with it.
Cheers,
Ben.
> Cc: Mike Marciniszyn <infinipath@intel.com>
> Cc: Doug Ledford <dledford@redhat.com>
> Cc: Sean Hefty <sean.hefty@intel.com>
> Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
> Cc: linux-rdma@vger.kernel.org
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
> Changes from v1:
> * resend because V1 never reached mailing list.
>
> NOTE: This is only compile tested and I am also not sure why ppc64
> needs special handling.
> We need this patch because the series at http://mid.gmane.org/1460182
> 444-2468-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com
> will drop _PAGE_WRITETHRU
>
> drivers/infiniband/hw/qib/qib_file_ops.c | 5 +----
> drivers/infiniband/hw/qib/qib_pcie.c | 6 ------
> 2 files changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/drivers/infiniband/hw/qib/qib_file_ops.c
> b/drivers/infiniband/hw/qib/qib_file_ops.c
> index e449e394963f..a3d593f546ec 100644
> --- a/drivers/infiniband/hw/qib/qib_file_ops.c
> +++ b/drivers/infiniband/hw/qib/qib_file_ops.c
> @@ -822,10 +822,7 @@ static int mmap_piobufs(struct vm_area_struct
> *vma,
> phys = dd->physaddr + piobufs;
>
> #if defined(__powerpc__)
> - /* There isn't a generic way to specify writethrough
> mappings */
> - pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE;
> - pgprot_val(vma->vm_page_prot) |= _PAGE_WRITETHRU;
> - pgprot_val(vma->vm_page_prot) &= ~_PAGE_GUARDED;
> + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
> #endif
>
> /*
> diff --git a/drivers/infiniband/hw/qib/qib_pcie.c
> b/drivers/infiniband/hw/qib/qib_pcie.c
> index 4758a3801ae8..6abe1c621aa4 100644
> --- a/drivers/infiniband/hw/qib/qib_pcie.c
> +++ b/drivers/infiniband/hw/qib/qib_pcie.c
> @@ -144,13 +144,7 @@ int qib_pcie_ddinit(struct qib_devdata *dd,
> struct pci_dev *pdev,
> addr = pci_resource_start(pdev, 0);
> len = pci_resource_len(pdev, 0);
>
> -#if defined(__powerpc__)
> - /* There isn't a generic way to specify writethrough
> mappings */
> - dd->kregbase = __ioremap(addr, len, _PAGE_NO_CACHE |
> _PAGE_WRITETHRU);
> -#else
> dd->kregbase = ioremap_nocache(addr, len);
> -#endif
> -
> if (!dd->kregbase)
> return -ENOMEM;
>
next prev parent reply other threads:[~2016-04-21 22:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-20 7:58 [PATCH V2] powerpc/infiniband: Use cache inhibitted and guarded mapping on powerpc Aneesh Kumar K.V
2016-04-20 7:58 ` Aneesh Kumar K.V
2016-04-20 16:29 ` Marciniszyn, Mike
2016-04-20 16:29 ` Marciniszyn, Mike
[not found] ` <32E1700B9017364D9B60AED9960492BC25ACE29D-RjuIdWtd+YbTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2016-04-26 11:03 ` Michael Ellerman
2016-04-26 11:03 ` Michael Ellerman
2016-04-21 22:47 ` Benjamin Herrenschmidt [this message]
2016-04-21 22:47 ` Benjamin Herrenschmidt
[not found] ` <1461278876.3135.18.camel-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
2016-04-22 16:09 ` Jason Gunthorpe
2016-04-22 16:09 ` Jason Gunthorpe
2016-04-23 8:25 ` Benjamin Herrenschmidt
2016-04-23 8:25 ` Benjamin Herrenschmidt
[not found] ` <1461399949.3135.52.camel-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
2016-04-24 17:33 ` Aneesh Kumar K.V
2016-04-24 17:33 ` Aneesh Kumar K.V
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=1461278876.3135.18.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=dledford@redhat.com \
--cc=hal.rosenstock@gmail.com \
--cc=infinipath@intel.com \
--cc=linux-rdma@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=sean.hefty@intel.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 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.