From: "Christian König" <christian.koenig@amd.com>
To: John Stultz <john.stultz@linaro.org>,
lkml <linux-kernel@vger.kernel.org>
Cc: "Daniel Vetter" <daniel@ffwll.ch>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Liam Mark" <lmark@codeaurora.org>,
"Chris Goldsworthy" <cgoldswo@codeaurora.org>,
"Laura Abbott" <labbott@kernel.org>,
"Brian Starkey" <Brian.Starkey@arm.com>,
"Hridya Valsaraju" <hridya@google.com>,
"Suren Baghdasaryan" <surenb@google.com>,
"Sandeep Patil" <sspatil@google.com>,
"Daniel Mentz" <danielmentz@google.com>,
"Ørjan Eide" <orjan.eide@arm.com>,
"Robin Murphy" <robin.murphy@arm.com>,
"Ezequiel Garcia" <ezequiel@collabora.com>,
"Simon Ser" <contact@emersion.fr>,
"James Jones" <jajones@nvidia.com>,
linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [RFC][PATCH v6 0/7] Generic page pool & deferred freeing for system dmabuf heap
Date: Fri, 5 Feb 2021 11:36:01 +0100 [thread overview]
Message-ID: <0864e2a8-3a44-e7db-828f-abdac7c64471@amd.com> (raw)
In-Reply-To: <20210205080621.3102035-1-john.stultz@linaro.org>
Am 05.02.21 um 09:06 schrieb John Stultz:
> 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.
We can easily do the testing and the general idea sounds solid to me.
I see three major things we need to clean up here.
1. The licensing, you are moving from BSD/MIT to GPL2.
2. Don't add any new overhead to the TTM pool, especially allocating a
private object per page is a no-go.
3. What are you doing with the reclaim stuff and why?
4. Keeping the documentation would be nice to have.
Regards,
Christian.
>
> thanks
> -john
>
> [1] https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fandroid.googlesource.com%2Fplatform%2Fsystem%2Fmemory%2Flibdmabufheap%2F%2B%2Frefs%2Fheads%2Fmaster%2Ftests%2Fdmabuf_heap_bench.c&data=04%7C01%7Cchristian.koenig%40amd.com%7C2dc4d6cb3ee246558b9e08d8c9acef9a%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637481091933715561%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=oMgVsrdlwS%2BqZuuatjTiWDzMU9SiUW5eRar5xwT%2BHYQ%3D&reserved=0
>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Christian Koenig <christian.koenig@amd.com>
> Cc: Sumit Semwal <sumit.semwal@linaro.org>
> Cc: Liam Mark <lmark@codeaurora.org>
> Cc: Chris Goldsworthy <cgoldswo@codeaurora.org>
> Cc: Laura Abbott <labbott@kernel.org>
> Cc: Brian Starkey <Brian.Starkey@arm.com>
> Cc: Hridya Valsaraju <hridya@google.com>
> Cc: Suren Baghdasaryan <surenb@google.com>
> Cc: Sandeep Patil <sspatil@google.com>
> Cc: Daniel Mentz <danielmentz@google.com>
> Cc: Ørjan Eide <orjan.eide@arm.com>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: Ezequiel Garcia <ezequiel@collabora.com>
> Cc: Simon Ser <contact@emersion.fr>
> Cc: James Jones <jajones@nvidia.com>
> Cc: linux-media@vger.kernel.org
> Cc: dri-devel@lists.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
>
next prev parent reply other threads:[~2021-02-05 10:42 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-05 8:06 John Stultz
2021-02-05 8:06 ` [RFC][PATCH v6 1/7] drm: Add a sharable drm page-pool implementation John Stultz
2021-02-05 8:46 ` Christian König
2021-02-05 20:46 ` John Stultz
2021-02-05 22:38 ` Suren Baghdasaryan
2021-02-09 12:11 ` Christian König
2021-02-09 12:57 ` Christian König
2021-02-09 17:33 ` Suren Baghdasaryan
2021-02-09 17:46 ` Christian König
2021-02-09 17:52 ` Suren Baghdasaryan
2021-02-09 20:03 ` Daniel Vetter
2021-02-09 20:16 ` Suren Baghdasaryan
2021-02-10 13:06 ` Daniel Vetter
2021-02-10 16:39 ` Suren Baghdasaryan
2021-02-10 17:21 ` Daniel Vetter
2021-02-10 17:28 ` Suren Baghdasaryan
2021-02-10 18:32 ` Christian König
2021-02-10 19:12 ` Suren Baghdasaryan
2021-02-10 19:23 ` Christian König
2021-02-09 17:51 ` John Stultz
2021-02-05 8:06 ` [RFC][PATCH v6 2/7] drm: ttm_pool: Rename the ttm_pool_dma structure to ttm_pool_page_dat John Stultz
2021-02-05 8:06 ` [RFC][PATCH v6 3/7] drm: ttm_pool: Rework ttm_pool_free_page to allow us to use it as a function pointer John Stultz
2021-02-05 8:28 ` Christian König
2021-02-05 19:47 ` John Stultz
2021-02-09 12:13 ` Christian König
2021-02-09 17:39 ` John Stultz
2021-02-05 8:06 ` [RFC][PATCH v6 4/7] drm: ttm_pool: Rework ttm_pool to use drm_page_pool John Stultz
2021-02-05 8:50 ` Christian König
2021-02-05 8:06 ` [RFC][PATCH v6 5/7] dma-buf: heaps: Add deferred-free-helper library code John Stultz
2021-02-05 8:06 ` [RFC][PATCH v6 6/7] dma-buf: system_heap: Add drm pagepool support to system heap John Stultz
2021-02-05 8:06 ` [RFC][PATCH v6 7/7] dma-buf: system_heap: Add deferred freeing to the " John Stultz
2021-02-05 10:36 ` Christian König [this message]
2021-02-05 20:57 ` [RFC][PATCH v6 0/7] Generic page pool & deferred freeing for system dmabuf heap John Stultz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0864e2a8-3a44-e7db-828f-abdac7c64471@amd.com \
--to=christian.koenig@amd.com \
--cc=Brian.Starkey@arm.com \
--cc=cgoldswo@codeaurora.org \
--cc=contact@emersion.fr \
--cc=daniel@ffwll.ch \
--cc=danielmentz@google.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ezequiel@collabora.com \
--cc=hridya@google.com \
--cc=jajones@nvidia.com \
--cc=john.stultz@linaro.org \
--cc=labbott@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=lmark@codeaurora.org \
--cc=orjan.eide@arm.com \
--cc=robin.murphy@arm.com \
--cc=sspatil@google.com \
--cc=sumit.semwal@linaro.org \
--cc=surenb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®