public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: John Stultz <john.stultz@linaro.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	"Sandeep Patil" <sspatil@google.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"Ezequiel Garcia" <ezequiel@collabora.com>,
	"Robin Murphy" <robin.murphy@arm.com>,
	"James Jones" <jajones@nvidia.com>,
	"Liam Mark" <lmark@codeaurora.org>,
	"Laura Abbott" <labbott@kernel.org>,
	"Chris Goldsworthy" <cgoldswo@codeaurora.org>,
	"Hridya Valsaraju" <hridya@google.com>,
	"Ørjan Eide" <orjan.eide@arm.com>,
	linux-media <linux-media@vger.kernel.org>,
	"Suren Baghdasaryan" <surenb@google.com>,
	"Daniel Mentz" <danielmentz@google.com>
Subject: Re: [RFC][PATCH 2/3] dma-buf: system_heap: Add pagepool support to system heap
Date: Mon, 21 Dec 2020 23:08:59 +0100	[thread overview]
Message-ID: <X+Ec+xVhyIUa7IsJ@phenom.ffwll.local> (raw)
In-Reply-To: <CALAqxLVtYVGSSYtFmMK6oM9JSEmY4RAXra89sECL2Z4YGPic0Q@mail.gmail.com>

On Fri, Dec 18, 2020 at 05:16:56PM -0800, John Stultz wrote:
> On Fri, Dec 18, 2020 at 6:36 AM Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Thu, Dec 17, 2020 at 11:06:11PM +0000, John Stultz wrote:
> > > Reuse/abuse the pagepool code from the network code to speed
> > > up allocation performance.
> > >
> > > This is similar to the ION pagepool usage, but tries to
> > > utilize generic code instead of a custom implementation.
> >
> > We also have one of these in ttm. I think we should have at most one of
> > these for the gpu ecosystem overall, maybe as a helper that can be plugged
> > into all the places.
> >
> > Or I'm kinda missing something, which could be since I only glanced at
> > yours for a bit. But it's also called page pool for buffer allocations,
> > and I don't think there's that many ways to implement that really :-)
> 
> Yea, when I was looking around the ttm one didn't seem quite as
> generic as the networking one, which more easily fit in here.

Oops, I didn't look that closely and didn't realize you're reusing the one
from net/core/.

> The main benefit for the system heap is not so much the pool itself
> (the normal page allocator is pretty good), as it being able to defer
> the free and zero the pages in a background thread, so the pool is
> effectively filled with pre-zeroed pages.
> 
> But I'll take another look at the ttm implementation and see if it can
> be re-used or the shared code refactored and pulled out somehow.

I think moving the page_pool from net into lib and using it in ttm might
also be an option. Lack of shrinker in the networking one might be a bit a
problem.

Also I guess the real fun will start if you pre-flush pages (after
zeroing) or use write-combined mode (which tends to be a real pain to
allocate). So for those I think we likely need more than just reusing the
one net/core has already.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2020-12-21 22:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 23:06 [RFC][PATCH 1/3] dma-buf: heaps: Add deferred-free-helper library code John Stultz
2020-12-17 23:06 ` [RFC][PATCH 2/3] dma-buf: system_heap: Add pagepool support to system heap John Stultz
2020-12-18 14:36   ` Daniel Vetter
2020-12-19  1:16     ` John Stultz
2020-12-21 22:08       ` Daniel Vetter [this message]
2021-01-23  1:28         ` John Stultz
2021-02-02 14:04           ` Daniel Vetter
2021-02-03  5:56             ` John Stultz
2021-02-03  9:46               ` Daniel Vetter
2020-12-17 23:06 ` [RFC][PATCH 3/3] dma-buf: system_heap: Add deferred freeing to the " John Stultz
2020-12-19 15:35   ` [dma] adc430f226: WARNING:at_kernel/sched/core.c:#__might_sleep kernel test robot
2020-12-22 17:41 ` [RFC][PATCH 1/3] dma-buf: heaps: Add deferred-free-helper library code Suren Baghdasaryan

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=X+Ec+xVhyIUa7IsJ@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=cgoldswo@codeaurora.org \
    --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=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