From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57400FC5910 for ; Thu, 26 Feb 2026 10:18:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B718410E8BD; Thu, 26 Feb 2026 10:18:13 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="YA05vn+G"; dkim-atps=neutral Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3349F10E8BD for ; Thu, 26 Feb 2026 10:18:13 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 54F0F60097; Thu, 26 Feb 2026 10:18:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 653B0C19423; Thu, 26 Feb 2026 10:18:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772101092; bh=tJEgWGAKGq9f+lDM1K325bKAQQGVyuPowxRSNNeauh8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YA05vn+GecAOHOV0bBkerBcyLQZtuSeUa6UQ7vgNRSwpIOnk1+Xg6+oT0x9IHtTrl onYSZPAZMTe0F6nGswJKHdgRDg7XQpXjYPnevq2aP5CjzYYkfR/90mmCWiRXuQKXgO +H6Xg/Rhq5agCeF2gZr/HUOYNb17ra9+vda9r0ixBAHkwbHtqrU3kZA80oQM3Md0VV 3oG+afWszq4v8KgLw8YU0gigEQkK/ASy2JB3YMNHuc2rU2TRc0G1OCIOlc/+VT9/An WWug7j7lR9Tts668IPaefBI8ZdIfDjIeHH8rA4GmNx2mGPbyBeq/94vk28A4Nl//XZ CkRcRNPs8Ilvw== Date: Thu, 26 Feb 2026 11:18:08 +0100 From: Maxime Ripard To: John Stultz Cc: Sumit Semwal , Benjamin Gaignard , Brian Starkey , "T.J. Mercier" , Christian =?utf-8?B?S8O2bmln?= , Marek Szyprowski , Robin Murphy , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-mm@kvack.org Subject: Re: [PATCH 0/7] dma-buf: heaps: Turn heaps into modules Message-ID: <20260226-adaptable-vermilion-nautilus-0aa6f0@penduick> References: <20260225-dma-buf-heaps-as-modules-v1-0-2109225a090d@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha384; protocol="application/pgp-signature"; boundary="sxksscuwilvy7rfq" Content-Disposition: inline In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" --sxksscuwilvy7rfq Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH 0/7] dma-buf: heaps: Turn heaps into modules MIME-Version: 1.0 Hi John, Thanks for the review On Wed, Feb 25, 2026 at 10:51:30AM -0800, John Stultz wrote: > On Wed, Feb 25, 2026 at 8:42=E2=80=AFAM Maxime Ripard wrote: > > > > The recent introduction of heaps in the optee driver [1] made possible > > the creation of heaps as modules. > > > > It's generally a good idea if possible, including for the already > > existing system and CMA heaps. > > > > The system one is pretty trivial, the CMA one is a bit more involved, > > especially since we have a call from kernel/dma/contiguous.c to the CMA > > heap code. This was solved by turning the logic around and making the > > CMA heap call into the contiguous DMA code. > > >=20 > So heaps-as-modules is common in the Android kernels, and was > attempted to be upstreamed long ago: > https://lore.kernel.org/lkml/20191025234834.28214-1-john.stultz@linaro.= org/ >=20 > And it got a fairly chilly reception, but maybe having the additional > optee heap (as well as other proposed heaps) might sway folks on this > now. I didn't know that Android was using heap as modules only, but I'd say that it's even more of a reason to upstream it then. > There is also the kref bits you might need (which Android still carries): > https://lore.kernel.org/lkml/20200725032633.125006-1-john.stultz@linaro= =2Eorg/ I'm curious about this one though. It looks like you add refcounting, but never really get the references anywhere. What was your intent, that on every allocation the buffer would get a reference to the heap so we avoid removing a heap with allocated buffers? Maxime --sxksscuwilvy7rfq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJUEABMJAB0WIQTkHFbLp4ejekA/qfgnX84Zoj2+dgUCaaAd3wAKCRAnX84Zoj2+ dircAYDWmwkdH/3AAjuPp85DnYNPbSGFdhX/eyVBlLKWPqfln+xq2+gc6gDrOAAL OyDKUToBf19j250y3Z4PQ7QYr1AXEq1bAKHYLpYrTQLrYCtOtKbL3L1J1eqyj4Jl H3gZy48H7w== =URjd -----END PGP SIGNATURE----- --sxksscuwilvy7rfq--