netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: "Christoph Hellwig" <hch@lst.de>,
	"Tushar Dave" <tushar.n.dave@oracle.com>,
	"xdp-newbies@vger.kernel.org" <xdp-newbies@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"William Tu" <u9012063@gmail.com>,
	"Björn Töpel" <bjorn.topel@intel.com>,
	"Karlsson, Magnus" <magnus.karlsson@intel.com>,
	"Alexander Duyck" <alexander.duyck@gmail.com>,
	"Arnaldo Carvalho de Melo" <acme@redhat.com>,
	brouer@redhat.com
Subject: Re: XDP performance regression due to CONFIG_RETPOLINE Spectre V2
Date: Mon, 16 Apr 2018 08:02:50 +0200	[thread overview]
Message-ID: <20180416080244.54a32bde@redhat.com> (raw)
In-Reply-To: <1523734166.15648.5.camel@infradead.org>

On Sat, 14 Apr 2018 21:29:26 +0200
David Woodhouse <dwmw2@infradead.org> wrote:

> On Fri, 2018-04-13 at 19:26 +0200, Christoph Hellwig wrote:
> > On Fri, Apr 13, 2018 at 10:12:41AM -0700, Tushar Dave wrote:  
> > > I guess there is nothing we need to do!
> > >
> > > On x86, in case of no intel iommu or iommu is disabled, you end up in
> > > swiotlb for DMA API calls when system has 4G memory.
> > > However, AFAICT, for 64bit DMA capable devices swiotlb DMA APIs do not
> > > use bounce buffer until and unless you have swiotlb=force specified in
> > > kernel commandline.  
> > 
> > Sure.  But that means very sync_*_to_device and sync_*_to_cpu now
> > involves an indirect call to do exactly nothing, which in the workload
> > Jesper is looking at is causing a huge performance degradation due to
> > retpolines.  

Yes, exactly.

> 
> We should look at using the
> 
>  if (dma_ops == swiotlb_dma_ops)
>     swiotlb_map_page()
>  else
>     dma_ops->map_page()
> 
> trick for this. Perhaps with alternatives so that when an Intel or AMD
> IOMMU is detected, it's *that* which is checked for as the special
> case.

Yes, this trick is basically what I'm asking for :-)

It did sound like Hellwig wanted to first avoid/fix that x86 end-up
defaulting to swiotlb.  Thus, we just have to do the same trick with
the new default fall-through dma_ops.

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

  reply	other threads:[~2018-04-16  6:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-12 13:50 XDP performance regression due to CONFIG_RETPOLINE Spectre V2 Jesper Dangaard Brouer
2018-04-12 14:51 ` Christoph Hellwig
2018-04-12 14:56   ` Christoph Hellwig
2018-04-12 15:31     ` Jesper Dangaard Brouer
2018-04-13 16:49       ` Christoph Hellwig
2018-04-13 17:12     ` Tushar Dave
2018-04-13 17:26       ` Christoph Hellwig
2018-04-14 19:29         ` David Woodhouse
2018-04-16  6:02           ` Jesper Dangaard Brouer [this message]
2018-04-16 12:27 ` Christoph Hellwig
2018-04-16 16:04   ` Alexander Duyck
2018-04-17  6:19     ` Christoph Hellwig
2018-04-16 18:05   ` dma-mapping: bypass dma_ops for direct mappings kbuild test robot
2018-04-16 18:26     ` Jesper Dangaard Brouer
2018-04-16 18:31   ` kbuild test robot
2018-04-16 21:07   ` XDP performance regression due to CONFIG_RETPOLINE Spectre V2 Jesper Dangaard Brouer
2018-04-17  6:15     ` Christoph Hellwig
2018-04-17  7:07       ` Jesper Dangaard Brouer
2018-04-17  7:13         ` Christoph Hellwig

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=20180416080244.54a32bde@redhat.com \
    --to=brouer@redhat.com \
    --cc=acme@redhat.com \
    --cc=alexander.duyck@gmail.com \
    --cc=bjorn.topel@intel.com \
    --cc=dwmw2@infradead.org \
    --cc=hch@lst.de \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=tushar.n.dave@oracle.com \
    --cc=u9012063@gmail.com \
    --cc=xdp-newbies@vger.kernel.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 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).