|
|
Subscribe / Log in / New account

avoid indirect calls for DMA direct mappings v2

From:  Christoph Hellwig <hch-AT-lst.de>
To:  iommu-AT-lists.linux-foundation.org, Linus Torvalds <torvalds-AT-linux-foundation.org>, Jesper Dangaard Brouer <brouer-AT-redhat.com>
Subject:  [RFC] avoid indirect calls for DMA direct mappings v2
Date:  Fri, 7 Dec 2018 11:07:05 -0800
Message-ID:  <20181207190720.18517-1-hch@lst.de>
Cc:  Tariq Toukan <tariqt-AT-mellanox.com>, Ilias Apalodimas <ilias.apalodimas-AT-linaro.org>, =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke-AT-toke.dk>, Robin Murphy <robin.murphy-AT-arm.com>, Konrad Rzeszutek Wilk <konrad.wilk-AT-oracle.com>, Tony Luck <tony.luck-AT-intel.com>, Fenghua Yu <fenghua.yu-AT-intel.com>, Marek Szyprowski <m.szyprowski-AT-samsung.com>, Keith Busch <keith.busch-AT-intel.com>, Jonathan Derrick <jonathan.derrick-AT-intel.com>, linux-pci-AT-vger.kernel.org, linux-ia64-AT-vger.kernel.org, x86-AT-kernel.org, linux-kernel-AT-vger.kernel.org
Archive-link:  Article

Hi all,

a while ago Jesper reported major performance regressions due to the
spectre v2 mitigations in his XDP forwarding workloads.  A large part
of that is due to the DMA mapping API indirect calls.

It turns out that the most common implementation of the DMA API is the
direct mapping case, and now that we have merged almost all duplicate
implementations of that into a single generic one is easily feasily to
direct calls for this fast path.

This series adds consolidate the DMA mapping code by merging the
swiotlb case into the dma direct case, and then treats NULL dma_ops
as an indicator that that we should directly call the direct mapping
case.  This recovers a large part of the retpoline induces XDP slowdown.

This works is based on the dma-mapping tree, so you probably want to
want this git tree for testing:

    git://git.infradead.org/users/hch/misc.git dma-direct-calls.2

Gitweb:

    http://git.infradead.org/users/hch/misc.git/shortlog/refs...

Changes since v1:
 - now also includes all the prep patches relative to the dma-mapping
   for-next tree
 - move various slow path functions out of line
 - use a NULL dma ops as the indicate to use the direct mapping path
 - remove dma_direct_ops now that we always call it without the indirection
 - move the dummy dma ops to common code
 - explicitly st the dummy dma ops for devices that are indicates as not
   DMA capable by firmware


Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds