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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09FC3C0015E for ; Tue, 1 Aug 2023 17:18:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234368AbjHARSr (ORCPT ); Tue, 1 Aug 2023 13:18:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231742AbjHARSo (ORCPT ); Tue, 1 Aug 2023 13:18:44 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 646DB211E; Tue, 1 Aug 2023 10:18:43 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id AF5E46732D; Tue, 1 Aug 2023 19:18:38 +0200 (CEST) Date: Tue, 1 Aug 2023 19:18:38 +0200 From: Christoph Hellwig To: Pintu Agarwal Cc: Christoph Hellwig , Pintu Kumar , linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, m.szyprowski@samsung.com, robin.murphy@arm.com, iommu@lists.linux.dev, Sumit Semwal , Benjamin Gaignard , Liam Mark , Laura Abbott , Brian Starkey , John Stultz , Christian =?iso-8859-1?Q?K=F6nig?= , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org Subject: Re: [PATCH v2] dma-contiguous: define proper name for global cma region Message-ID: <20230801171838.GA14599@lst.de> References: <1690598115-26287-1-git-send-email-quic_pintu@quicinc.com> <20230731112155.GA3662@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 01, 2023 at 10:42:42PM +0530, Pintu Agarwal wrote: > > I agree that reserved is not a very useful name. Unfortuately the > > name of the region leaks to userspace through cma_heap. > > > > So I think we need prep patches to hardcode "reserved" in > > add_default_cma_heap first, and then remove the cma_get_name > > first. > > Sorry, but I could not fully understand your comments. > Can you please elaborate a little more what changes are required in > cma_heap if we change "reserved" to "global-cma-region" ? Step 1: Instead of setting exp_info.name to cma_get_name(cma); in __add_cma_heap just set it to "reserved", probably by passing a name argument. You can also remove the unused data argument to __add_cma_heap and/or just fold that function into the only caller while you're at it. Step 2: Remove cma_get_name, as it is unused now. Step 3: The patch your previously sent. > You mean to say there are userspace tools that rely on this "reserved" > naming for global cma ? Yes.