Skip to content

dma-buf: Code rework and performance improvements for system heap

John Stultz dri-devel linux-media lkml 8 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest5 patches 2 repliesIn review
  2. v65 patches 0 repliesSuperseded
  3. v57 patches 11 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v4 posting 2/27 patches4 repliesSuperseded
v4 posting 1/27 patches0 repliesSuperseded
v37 patches10 repliesSuperseded
v26 patches0 repliesSuperseded
v1 RFC6 patches4 repliesSuperseded

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5dma-buf: system_heap: Rework system heap to use sgtables instead of pagelistsdrivers/dma-buf/heaps/system_heap.c+303 -460 replies
2/5dma-buf: heaps: Move heap-helper logic into the cma_heap implementationdrivers/dma-buf/heaps/cma_heap.c+270 -494 replies
3/5dma-buf: heaps: Remove heap-helpers codedrivers/dma-buf/heaps/Makefile drivers/dma-buf/heaps/heap-helpers.c drivers/dma-buf/heaps/heap-helpers.h+0 -3280 replies
4/5dma-buf: heaps: Skip sync if not mappeddrivers/dma-buf/heaps/cma_heap.c drivers/dma-buf/heaps/system_heap.c+20 -00 replies
5/5dma-buf: system_heap: Allocate higher order pages if availabledrivers/dma-buf/heaps/system_heap.c+71 -180 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchBrian Starkey
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v7 thread

Cover letter [PATCH v7 0/5] dma-buf: Code rework and performance improvements for system heap

Hey All,
So Sumit noted a flub I made in adapting the last series to
the new dma-buf-map code that is in drm-misc-next. Thus I wanted to send this (hopefully) last revision of my patch series of performance optimizations to the dma-buf system heap, once again against drm-misc-next.

This series reworks the system heap to use sgtables, and then consolidates the pagelist method from the heap-helpers into the CMA heap. After which the heap-helpers logic is removed (as it is unused). I'd still like to find a better way to avoid some of the logic duplication in implementing the entire dma_buf_ops handlers per heap. But unfortunately that code is tied somewhat to how the buffer's memory is tracked. As more heaps show up I think we'll have a better idea how to best share code, so for now I think this is ok.

After this, the series introduces an optimization that Ørjan Eide implemented for ION that avoids calling sync on attachments that don't have a mapping.

Finally, an optimization to use larger order pages for the system heap. This change brings us closer to the current performance of the ION allocation code (though there still is a gap due to ION using a mix of deferred-freeing and page pools, I'll be looking at integrating those eventually).

This version of the series does not include the system-uncached heap as Daniel wanted further demonstration that it is useful with devices that use the mesa stack. I'm working on such a justification but I don't want to hold up these rework patches in the meantime.

thanks
-john

New in v7:
* Fixed the incorrect adaptation to the dma-buf-map usage

Cc Sumit Semwal <[email protected]>
Cc Liam Mark <[email protected]>
Cc Laura Abbott <[email protected]>
Cc Brian Starkey <[email protected]>
Cc Hridya Valsaraju <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Sandeep Patil <[email protected]>
Cc Daniel Mentz <[email protected]>
Cc Chris Goldsworthy <[email protected]>
Cc Ørjan Eide <[email protected]>
Cc Robin Murphy <[email protected]>
Cc Ezequiel Garcia <[email protected]>
Cc Simon Ser <[email protected]>
Cc James Jones <[email protected]>

John Stultz (5):
dma-buf: system_heap: Rework system heap to use sgtables instead of
pagelists
dma-buf: heaps: Move heap-helper logic into the cma_heap
implementation
dma-buf: heaps: Remove heap-helpers code
dma-buf: heaps: Skip sync if not mapped
dma-buf: system_heap: Allocate higher order pages if available

 drivers/dma-buf/heaps/Makefile       |   1 -
 drivers/dma-buf/heaps/cma_heap.c     | 329 +++++++++++++++++----
 drivers/dma-buf/heaps/heap-helpers.c | 274 ------------------
 drivers/dma-buf/heaps/heap-helpers.h |  53 ----
 drivers/dma-buf/heaps/system_heap.c  | 414 ++++++++++++++++++++++++---
 5 files changed, 647 insertions(+), 424 deletions(-)
 delete mode 100644 drivers/dma-buf/heaps/heap-helpers.c
 delete mode 100644 drivers/dma-buf/heaps/heap-helpers.h
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel