Linux DMA Mapping Updates Help Recover Losses Caused By Spectre V2 Retpolines

Written by Michael Larabel in Linux Kernel on 21 December 2018 at 06:24 AM EST. 1 Comment
LINUX KERNEL
Yet another pull request sent in early ahead of the holidays for the Linux 4.21 kernel merge window are the DMA-Mapping updates managed by Christoph Hellwig. Normally the DMA-Mapping changes aren't really worth noting on Phoronix, but this time around it brings some improvements to help offset the overhead incurred by Retpolines for Spectre V2 mitigation.

While the year started looking rather brutal for Linux performance due to the costs associated with Spectre and Meltdown mitigations, fortunately, as we end 2018 there has been a lot of that overhead reduced and other ongoing optimizations. The latest example of this is with the DMA-Mapping changes to help recover much of the impact Retpolines had on the DMA code.

The patch series worth mentioning from this pull request is for avoiding indirect calls for DMA direct mappings. This patch series is able to recover much of the Retpoline overhead by consolidating a lot of the DMA mapping code into a single code path and from there using direct calls as much as possible in "avoiding huge retpoline overhead for high performance workloads." Tests were done against an XDP forwarding workload and it was found this patch series recovers a "large part" of that Retpoline induced slowdown. Red Hat kernel engineer Jesper Brouer confirmed the successes of this patch series.

That work and more is included as part of this pull request.

It's great to see the continued work on offsetting the overhead caused by Spectre/Meltdown while in 2019 we will see processors with more hardware-based mitigations.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week