Re: [PATCH] iommu/amd - Optimize PPR log handling

From: Gary R Hook
Date: Tue May 29 2018 - 13:29:12 EST


On 05/29/2018 09:54 AM, Joerg Roedel wrote:
Hey Gary,

On Fri, May 18, 2018 at 04:51:56PM -0500, Gary R Hook wrote:
Improve the performance of the PPR log polling function (i.e. the
task of emptying the log) by minimizing MMIO operations and more
efficiently processing groups of log entries. Cache the head
pointer, as there's never a reason to read it. Ensure the head
pointer register is updated every so often, to inform the IOMMU
that space is available in the log.

Finally, since a single pass may leave logged events unread, use
an outer loop to repeat until head has caught up to tail.

Signed-off-by: Gary R Hook <gary.hook@xxxxxxx>

Do you have numbers for the performance improvement? How did you test
this patch?

No, no numbers. We're still working out how best to test this, and suggestions/strategies are welcome.

The change is modeled after the function iommu_poll_events(), which is much cleaner. The GA log handling should be changed, as well (there are superfluous writes in the loop), but I figured, "one thing at a time". This is admittedly a minor optimization, but discussions with Tom Lendacky have led us down this path.

Your feedback is appreciated.

Gary