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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4590EC64E90 for ; Wed, 2 Dec 2020 00:57:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8C9AB207FF for ; Wed, 2 Dec 2020 00:57:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8C9AB207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A1FF48D0001; Tue, 1 Dec 2020 19:57:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A9656B005D; Tue, 1 Dec 2020 19:57:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 896F88D0001; Tue, 1 Dec 2020 19:57:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0208.hostedemail.com [216.40.44.208]) by kanga.kvack.org (Postfix) with ESMTP id 7015D6B005C for ; Tue, 1 Dec 2020 19:57:48 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3BA5F1EF3 for ; Wed, 2 Dec 2020 00:57:48 +0000 (UTC) X-FDA: 77546529816.13.head58_5e179d3273af Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 1852218140B67 for ; Wed, 2 Dec 2020 00:57:48 +0000 (UTC) X-HE-Tag: head58_5e179d3273af X-Filterd-Recvd-Size: 7174 Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Wed, 2 Dec 2020 00:57:47 +0000 (UTC) Received: by mail-pj1-f66.google.com with SMTP id iq13so159698pjb.3 for ; Tue, 01 Dec 2020 16:57:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=u8Im7pUwrYZIu0XDUm9McsW1+o37J6dtqvcGYr5EvvM=; b=BnMvomIwBI3N+KOtQT5gvAZ/YPOL8nQXrf/ciAdUfG5qC1YcnabTxSnt9cO6TqDkXe IRnzisbugfBMeNR0WQI7AwXJQcZ7jyCWZYxm08Pk9oJhdf3ohxx2I+QY//Cb4VOjGN8J GRSaLptkBC5pFQq+vU0fL07Y3N0F+XJ/+RvwAdNFo8IZj8Dfy9YO3keqmv8USbRf0DOp vDbubF3pCJlM/dC5ieG40aFeYOgv5M8BJbY4MAsBNGo0dJ0S0vjoKe9MDoCHuaKxRE2H N7SeLTWHPOwKsylRr4MRmmL1KqAtMLDWcfluBLALNHXtKGhT90oXL15G73UGqOSbbZUU e3FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=u8Im7pUwrYZIu0XDUm9McsW1+o37J6dtqvcGYr5EvvM=; b=JG4J3EhGY1FiHwANLOnK1pmTIG0k33FwI2y5IWyN6BSWItdq34X4E9ZAbf+IzhBeMv y6EWzsdLrlDXZobRuS5tYCMDGK0jI17i3Wpc4aKnE3r7j2aGpPeucy8v7LGmVVgu1Pmd y3ztqvs6p31g0eOd5VZ8Hfqy7wW8Q5/b6xEQ9BKanUlUsf55G8Wes4jvRl/L+jGIv20G 1dKe6ZyawgSevd6n1qC7H9EDM5f7QPY0PuJD3DibQLeP4wxNs+H/zEFK5E3eTX64INxz 04BxnRg0pDpbqLi+071Udve46R4/JXPYAKLK6QXCiiarcvsxyDIjpN/HURDPlri7D/O4 cbWg== X-Gm-Message-State: AOAM530HF1Y6lFW+F9azyo6EJQAwYqkzEASsXAz1IUzVzot1ViNLM0oz k4o786mqjCTQ6qqDOQix/dI= X-Google-Smtp-Source: ABdhPJxOwt1LLWu0zBZo4zhSX/vym8XXbM9DzbOWO25SHPiEUpnWcuYQuilFfwq2/N2y63yU4bdXqA== X-Received: by 2002:a17:90a:ee8c:: with SMTP id i12mr406366pjz.33.1606870666635; Tue, 01 Dec 2020 16:57:46 -0800 (PST) Received: from google.com ([2620:15c:211:201:7220:84ff:fe09:5e58]) by smtp.gmail.com with ESMTPSA id y25sm119905pfn.44.2020.12.01.16.57.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 16:57:45 -0800 (PST) Date: Tue, 1 Dec 2020 16:57:42 -0800 From: Minchan Kim To: John Stultz Cc: Andrew Morton , LKML , linux-mm , Hyesoo Yu , Matthew Wilcox , david@redhat.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, Suren Baghdasaryan , KyongHo Cho , John Dias , Hridya Valsaraju , Sumit Semwal , Brian Starkey , linux-media , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Rob Herring , Christian Koenig , "moderated list:DMA BUFFER SHARING FRAMEWORK" Subject: Re: [PATCH v2 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps Message-ID: <20201202005742.GC3968963@google.com> References: <20201201175144.3996569-1-minchan@kernel.org> <20201201175144.3996569-5-minchan@kernel.org> <20201201225554.GA3968963@google.com> <20201202001302.GB3968963@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Dec 01, 2020 at 04:33:14PM -0800, John Stultz wrote: > On Tue, Dec 1, 2020 at 4:13 PM Minchan Kim wrote: > > > > On Tue, Dec 01, 2020 at 03:38:14PM -0800, John Stultz wrote: > > > On Tue, Dec 1, 2020 at 2:55 PM Minchan Kim wrote: > > > > On Tue, Dec 01, 2020 at 11:48:15AM -0800, John Stultz wrote: > > > > > On Tue, Dec 1, 2020 at 9:51 AM Minchan Kim wrote: > > > > > > > > > > Thanks for reworking and resending this! > > > > > > > > > > ... > > > > > > +static int __init chunk_heap_init(void) > > > > > > +{ > > > > > > + struct cma *default_cma = dev_get_cma_area(NULL); > > > > > > + struct dma_heap_export_info exp_info; > > > > > > + struct chunk_heap *chunk_heap; > > > > > > + > > > > > > + if (!default_cma) > > > > > > + return 0; > > > > > > + > > > > > > + chunk_heap = kzalloc(sizeof(*chunk_heap), GFP_KERNEL); > > > > > > + if (!chunk_heap) > > > > > > + return -ENOMEM; > > > > > > + > > > > > > + chunk_heap->order = CHUNK_HEAP_ORDER; > > > > > > + chunk_heap->cma = default_cma; > > > > > > + > > > > > > + exp_info.name = cma_get_name(default_cma); > > > > > > > > > > So, this would create a chunk heap name with the default CMA name, > > > > > which would be indistinguishable from the heap name used for the plain > > > > > CMA heap. > > > > > > > > > > Probably a good idea to prefix it with "chunk-" so the heap device > > > > > names are unique? > > > > > > > > That will give an impression to user that they are using different CMA > > > > area but that's not true. IMHO, let's be honest at this moment. > > > > > > I disagree. The dmabuf heaps provide an abstraction for allocating a > > > type of memory, and while your heap is pulling from CMA, you aren't > > > "just" allocating CMA as the existing CMA heap would suffice for that. > > > > > > Since you need a slightly different method to allocate high order > > > pages in bulk, we really should have a unique way to name the > > > allocator interface. That's why I'd suggest the "chunk-" prefix to the > > > heap name. > > > > Got it. How about this? > > > > diff --git a/drivers/dma-buf/heaps/chunk_heap.c b/drivers/dma-buf/heaps/chunk_heap.c > > index 0277707a93a9..36e189d0b73d 100644 > > --- a/drivers/dma-buf/heaps/chunk_heap.c > > +++ b/drivers/dma-buf/heaps/chunk_heap.c > > @@ -410,7 +410,7 @@ static int __init chunk_heap_init(void) > > chunk_heap->order = CHUNK_HEAP_ORDER; > > chunk_heap->cma = default_cma; > > > > - exp_info.name = cma_get_name(default_cma); > > + exp_info.name = "cma-chunk-heap"; > > That's still a bit general for the default cma (which can be named > differently). I think including cma name is important, just adding the > chunk prefix might be best. > > So something like > sprintf(buf, "chunk-%s", cma_get_name(default_cma)); > exp_info.name = buf; No problem. Will do that in respoin. Other than that, can you give any Acked-by or Reviewed-by to save iteration?