<div dir="ltr"><div dir="ltr">On Tue, 10 Nov 2020 at 03:49, John Stultz <<a href="mailto:john.stultz@linaro.org">john.stultz@linaro.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hey All,<br>
  So just wanted to send my last revision of my patch series<br>
of performance optimizations to the dma-buf system heap.<br>
<br>
This series reworks the system heap to use sgtables, and then<br>
consolidates the pagelist method from the heap-helpers into the<br>
CMA heap. After which the heap-helpers logic is removed (as it<br>
is unused). I'd still like to find a better way to avoid some of<br>
the logic duplication in implementing the entire dma_buf_ops<br>
handlers per heap. But unfortunately that code is tied somewhat<br>
to how the buffer's memory is tracked. As more heaps show up I<br>
think we'll have a better idea how to best share code, so for<br>
now I think this is ok.<br>
<br>
After this, the series introduces an optimization that<br>
Ørjan Eide implemented for ION that avoids calling sync on<br>
attachments that don't have a mapping.<br>
<br>
Next, an optimization to use larger order pages for the system<br>
heap. This change brings us closer to the current performance<br>
of the ION allocation code (though there still is a gap due<br>
to ION using a mix of deferred-freeing and page pools, I'll be<br>
looking at integrating those eventually).<br>
<br>
Finally, a reworked version of my uncached system heap<br>
implementation I was submitting a few weeks back. Since it<br>
duplicated a lot of the now reworked system heap code, I<br>
realized it would be much simpler to add the functionality to<br>
the system_heap implementation itself.<br>
<br>
While not improving the core allocation performance, the<br>
uncached heap allocations do result in *much* improved<br>
performance on HiKey960 as it avoids a lot of flushing and<br>
invalidating buffers that the cpu doesn't touch often.<br>
<br>
Feedback on these would be great!<br>
<br>
thanks<br>
-john<br>
<br>
New in v5:<br>
* Added a comment explaining why the order sizes are<br>
  chosen as they are<br>
<br>
Cc: Sumit Semwal <<a href="mailto:sumit.semwal@linaro.org" target="_blank">sumit.semwal@linaro.org</a>><br>
Cc: Liam Mark <<a href="mailto:lmark@codeaurora.org" target="_blank">lmark@codeaurora.org</a>><br>
Cc: Laura Abbott <<a href="mailto:labbott@kernel.org" target="_blank">labbott@kernel.org</a>><br>
Cc: Brian Starkey <<a href="mailto:Brian.Starkey@arm.com" target="_blank">Brian.Starkey@arm.com</a>><br>
Cc: Hridya Valsaraju <<a href="mailto:hridya@google.com" target="_blank">hridya@google.com</a>><br>
Cc: Suren Baghdasaryan <<a href="mailto:surenb@google.com" target="_blank">surenb@google.com</a>><br>
Cc: Sandeep Patil <<a href="mailto:sspatil@google.com" target="_blank">sspatil@google.com</a>><br>
Cc: Daniel Mentz <<a href="mailto:danielmentz@google.com" target="_blank">danielmentz@google.com</a>><br>
Cc: Chris Goldsworthy <<a href="mailto:cgoldswo@codeaurora.org" target="_blank">cgoldswo@codeaurora.org</a>><br>
Cc: Ørjan Eide <<a href="mailto:orjan.eide@arm.com" target="_blank">orjan.eide@arm.com</a>><br>
Cc: Robin Murphy <<a href="mailto:robin.murphy@arm.com" target="_blank">robin.murphy@arm.com</a>><br>
Cc: Ezequiel Garcia <<a href="mailto:ezequiel@collabora.com" target="_blank">ezequiel@collabora.com</a>><br>
Cc: Simon Ser <<a href="mailto:contact@emersion.fr" target="_blank">contact@emersion.fr</a>><br>
Cc: James Jones <<a href="mailto:jajones@nvidia.com" target="_blank">jajones@nvidia.com</a>><br>
Cc: <a href="mailto:linux-media@vger.kernel.org" target="_blank">linux-media@vger.kernel.org</a><br>
Cc: <a href="mailto:dri-devel@lists.freedesktop.org" target="_blank">dri-devel@lists.freedesktop.org</a><br>
<br>
John Stultz (7):<br>
  dma-buf: system_heap: Rework system heap to use sgtables instead of<br>
    pagelists<br>
  dma-buf: heaps: Move heap-helper logic into the cma_heap<br>
    implementation<br>
  dma-buf: heaps: Remove heap-helpers code<br>
  dma-buf: heaps: Skip sync if not mapped<br>
  dma-buf: system_heap: Allocate higher order pages if available<br>
  dma-buf: dma-heap: Keep track of the heap device struct<br>
  dma-buf: system_heap: Add a system-uncached heap re-using the system<br>
    heap<br>
<br>
 drivers/dma-buf/dma-heap.c           |  33 +-<br>
 drivers/dma-buf/heaps/Makefile       |   1 -<br>
 drivers/dma-buf/heaps/cma_heap.c     | 324 +++++++++++++++---<br>
 drivers/dma-buf/heaps/heap-helpers.c | 270 ---------------<br>
 drivers/dma-buf/heaps/heap-helpers.h |  53 ---<br>
 drivers/dma-buf/heaps/system_heap.c  | 494 ++++++++++++++++++++++++---<br>
 include/linux/dma-heap.h             |   9 +<br>
 7 files changed, 753 insertions(+), 431 deletions(-)<br>
 delete mode 100644 drivers/dma-buf/heaps/heap-helpers.c<br>
 delete mode 100644 drivers/dma-buf/heaps/heap-helpers.h</blockquote><div><br></div><div>John, did this ever make it past v5?  I don't see a follow-up.</div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div><span style="font-size:12.8px">Lee Jones [李琼斯]</span></div><div><span style="font-size:12.8px">Linaro Services Senior Technical Lead</span></div><div><span style="font-size:12.8px">Linaro.org │ Open source software for ARM SoCs</span></div><div><span style="font-size:12.8px">Follow Linaro: Facebook | Twitter | Blog</span></div></div></div></div></div></div></div>