[RFC][PATCH 3/5 v2] dma-buf: heaps: Add system heap to dmabuf heaps

John Stultz john.stultz at linaro.org
Wed Mar 13 22:49:13 UTC 2019


On Wed, Mar 13, 2019 at 1:20 PM Liam Mark <lmark at codeaurora.org> wrote:
> On Tue, 5 Mar 2019, John Stultz wrote:
> > +
> > +             page = alloc_page(GFP_KERNEL);
>
> Need to zero the allocation (add __GFP_ZERO)

Ah! Thanks! Fixed now.

> > +             if (!page)
> > +                     goto err2;
> > +             sg_set_page(sg, page, PAGE_SIZE, 0);
> > +     }
> > +
>
> Can always be done later, but it may be helpful to also move this common
> code from here (and from the cma heap) to the heap helpers file as it
> reduces code but will also make it easier to introduce future debug
> features such as making the dma buf names unique
> to help make it easier to track down the source of memory leaks.

I think this is a good suggestion, but I do want to be careful to try
to make sure we add debugging tools to the larger dmabuf
infrastructure, rather then just the heap code (though having some
heap specific usage info would still be good). I think there's a
separate patchset to dmabufs originally from Greg Hackmann that
provides names that is supposed to help with what your suggesting.
  https://lists.freedesktop.org/archives/dri-devel/2019-February/208759.html

thanks!
-john


More information about the dri-devel mailing list