From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Stultz Subject: Re: [RFC][PATCH 3/5 v2] dma-buf: heaps: Add system heap to dmabuf heaps Date: Wed, 13 Mar 2019 15:49:13 -0700 Message-ID: References: <1551819273-640-1-git-send-email-john.stultz@linaro.org> <1551819273-640-4-git-send-email-john.stultz@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Liam Mark Cc: lkml , Laura Abbott , Benjamin Gaignard , Greg KH , Sumit Semwal , Brian Starkey , "Andrew F . Davis" , Chenbo Feng , Alistair Strachan , dri-devel , Vincent Donnefort , Marissa Wall List-Id: dri-devel@lists.freedesktop.org On Wed, Mar 13, 2019 at 1:20 PM Liam Mark 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