[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210205080621.3102035-1-john.stultz@linaro.org>
Date: Fri, 5 Feb 2021 08:06:14 +0000
From: John Stultz <john.stultz@...aro.org>
To: lkml <linux-kernel@...r.kernel.org>
Cc: John Stultz <john.stultz@...aro.org>,
Daniel Vetter <daniel@...ll.ch>,
Christian Koenig <christian.koenig@....com>,
Sumit Semwal <sumit.semwal@...aro.org>,
Liam Mark <lmark@...eaurora.org>,
Chris Goldsworthy <cgoldswo@...eaurora.org>,
Laura Abbott <labbott@...nel.org>,
Brian Starkey <Brian.Starkey@....com>,
Hridya Valsaraju <hridya@...gle.com>,
Suren Baghdasaryan <surenb@...gle.com>,
Sandeep Patil <sspatil@...gle.com>,
Daniel Mentz <danielmentz@...gle.com>,
Ørjan Eide <orjan.eide@....com>,
Robin Murphy <robin.murphy@....com>,
Ezequiel Garcia <ezequiel@...labora.com>,
Simon Ser <contact@...rsion.fr>,
James Jones <jajones@...dia.com>, linux-media@...r.kernel.org,
dri-devel@...ts.freedesktop.org
Subject: [RFC][PATCH v6 0/7] Generic page pool & deferred freeing for system dmabuf heap
This series is starting to get long, so I figured I'd add a
short cover letter for context.
The point of this series is trying to add both deferred-freeing
logic as well as a page pool to the DMA-BUF system heap.
This is desired, as the combination of deferred freeing along
with the page pool allows us to offload page-zeroing out of
the allocation hot path. This was done originally with ION
and this patch series allows the DMA-BUF system heap to match
ION's system heap allocation performance in a simple
microbenchmark [1] (ION re-added to the kernel for comparision,
running on an x86 vm image):
./dmabuf-heap-bench -i 0 1 system
Testing dmabuf system vs ion heaptype 0 (flags: 0x1)
---------------------------------------------
dmabuf heap: alloc 4096 bytes 5000 times in 86572223 ns 17314 ns/call
ion heap: alloc 4096 bytes 5000 times in 97442526 ns 19488 ns/call
dmabuf heap: alloc 1048576 bytes 5000 times in 196635057 ns 39327 ns/call
ion heap: alloc 1048576 bytes 5000 times in 357323629 ns 71464 ns/call
dmabuf heap: alloc 8388608 bytes 5000 times in 3165445534 ns 633089 ns/call
ion heap: alloc 8388608 bytes 5000 times in 3699591271 ns 739918 ns/call
dmabuf heap: alloc 33554432 bytes 5000 times in 13327402517 ns 2665480 ns/call
ion heap: alloc 33554432 bytes 5000 times in 15292352796 ns 3058470 ns/call
Daniel didn't like earlier attempts to re-use the network
page-pool code to achieve this, and suggested the ttm_pool be
used instead. This required pulling the fairly tightly knit
ttm_pool logic apart, but after many failed attmempts I think
I found a workable abstraction to split out shared logic.
So this series contains a new generic drm_page_pool helper
library, converts the ttm_pool to use it, and then adds the
dmabuf deferred freeing and adds support to the dmabuf system
heap to use both deferred freeing and the new drm_page_pool.
Input would be greatly appreciated. Testing as well, as I don't
have any development hardware that utilizes the ttm pool.
thanks
-john
[1] https://android.googlesource.com/platform/system/memory/libdmabufheap/+/refs/heads/master/tests/dmabuf_heap_bench.c
Cc: Daniel Vetter <daniel@...ll.ch>
Cc: Christian Koenig <christian.koenig@....com>
Cc: Sumit Semwal <sumit.semwal@...aro.org>
Cc: Liam Mark <lmark@...eaurora.org>
Cc: Chris Goldsworthy <cgoldswo@...eaurora.org>
Cc: Laura Abbott <labbott@...nel.org>
Cc: Brian Starkey <Brian.Starkey@....com>
Cc: Hridya Valsaraju <hridya@...gle.com>
Cc: Suren Baghdasaryan <surenb@...gle.com>
Cc: Sandeep Patil <sspatil@...gle.com>
Cc: Daniel Mentz <danielmentz@...gle.com>
Cc: Ørjan Eide <orjan.eide@....com>
Cc: Robin Murphy <robin.murphy@....com>
Cc: Ezequiel Garcia <ezequiel@...labora.com>
Cc: Simon Ser <contact@...rsion.fr>
Cc: James Jones <jajones@...dia.com>
Cc: linux-media@...r.kernel.org
Cc: dri-devel@...ts.freedesktop.org
John Stultz (7):
drm: Add a sharable drm page-pool implementation
drm: ttm_pool: Rename the ttm_pool_dma structure to ttm_pool_page_dat
drm: ttm_pool: Rework ttm_pool_free_page to allow us to use it as a
function pointer
drm: ttm_pool: Rework ttm_pool to use drm_page_pool
dma-buf: heaps: Add deferred-free-helper library code
dma-buf: system_heap: Add drm pagepool support to system heap
dma-buf: system_heap: Add deferred freeing to the system heap
drivers/dma-buf/heaps/Kconfig | 5 +
drivers/dma-buf/heaps/Makefile | 1 +
drivers/dma-buf/heaps/deferred-free-helper.c | 145 ++++++++++
drivers/dma-buf/heaps/deferred-free-helper.h | 55 ++++
drivers/dma-buf/heaps/system_heap.c | 77 ++++-
drivers/gpu/drm/Kconfig | 5 +
drivers/gpu/drm/Makefile | 1 +
drivers/gpu/drm/page_pool.c | 220 +++++++++++++++
drivers/gpu/drm/ttm/ttm_pool.c | 278 ++++++-------------
include/drm/page_pool.h | 54 ++++
include/drm/ttm/ttm_pool.h | 23 +-
11 files changed, 639 insertions(+), 225 deletions(-)
create mode 100644 drivers/dma-buf/heaps/deferred-free-helper.c
create mode 100644 drivers/dma-buf/heaps/deferred-free-helper.h
create mode 100644 drivers/gpu/drm/page_pool.c
create mode 100644 include/drm/page_pool.h
--
2.25.1
Powered by blists - more mailing lists