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=-9.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 59A40C433E0 for ; Tue, 19 Jan 2021 20:43:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 17C8B2310D for ; Tue, 19 Jan 2021 20:43:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729159AbhASUig (ORCPT ); Tue, 19 Jan 2021 15:38:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732149AbhASUhY (ORCPT ); Tue, 19 Jan 2021 15:37:24 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59F33C061757; Tue, 19 Jan 2021 12:36:44 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id g15so673209pjd.2; Tue, 19 Jan 2021 12:36:44 -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=B8V4SvilY22Ou2CtEY4Ue8qbjrsp3tthnLCK+7Q59QY=; b=PeAXI8eTzedOObem6tpD3NZRZKrBkgPenj/spRJ6lVUlMubwNa3Hsb2icgzXSomLqy jZ0E6xPVrfpe5ilrFFeyILMIUF5YcgHQi8+CknGm8Z7ZWUZZCKKEMDt51BM3ZYstg0yS 2eROI954uU0JzmDnA7QdgSEGNXTAfT2mPXLCf5SRW6gvfz0nZx1CGzLXdOpj0nPZz7V4 y59gAQtbX2e1l++jNfgypKC6n73SaA/zOLG1zk0c85OMOYgSZgOx+w37YU2SDizmy0t1 fvYjxUEcFgSQxSZ+zg5/YjdqyN0owSiUhq96CQQhEn4PximkBY0CGFHHAzCp3nk1Coad NRDw== 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=B8V4SvilY22Ou2CtEY4Ue8qbjrsp3tthnLCK+7Q59QY=; b=eLbXha3AZwW4YcP11twEA0IatZARw2/7VYE3M+mL00WU+KOvcEkx7mJvTr8ARXyx1Y 5mOxcXSIkhVi6RrNjoGcavcmDuL5vSeUrZHYs8CuZW8P8aLyTay5yVWcBQ73uCHbS4uF MIzDm2NZHIwPbJWJ61bVLSVzfziSeMXEZumLv2gE+GWyygw1Lb+W267yuFE62GY3p+Wr EQlmnM8emIhhcIC4niHKUUgLkzVpAx/pyygIG1Sqox1Y6wB95MibXHnTjSQprOYNSA34 vFsOd2MDqUvrDAjhpiEhdtJFF3FVmCxqK/wbUAiKTsyC7kJVSwVHqCHNOxN0DSQhnzOg 6neQ== X-Gm-Message-State: AOAM533vqjPNcC4H53UdkkvpQtoFBbbH0rLrqHZcuZouz4sAM7jIDDuk AC0KNzhgf837gQFcsK0Z5mw= X-Google-Smtp-Source: ABdhPJxMgNFUumt9XiceexCYO3QOZQGhZnpeiTmcQUHGdDtv9MMjBRezO5wS52FU++T2/s/pwxcgsg== X-Received: by 2002:a17:902:d909:b029:df:52b4:8147 with SMTP id c9-20020a170902d909b02900df52b48147mr1944220plz.33.1611088603852; Tue, 19 Jan 2021 12:36:43 -0800 (PST) Received: from google.com ([2620:15c:211:201:8d1f:e7:cd3c:db2f]) by smtp.gmail.com with ESMTPSA id b67sm1171pfa.140.2021.01.19.12.36.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jan 2021 12:36:42 -0800 (PST) Sender: Minchan Kim Date: Tue, 19 Jan 2021 12:36:40 -0800 From: Minchan Kim To: John Stultz Cc: Andrew Morton , linux-mm , LKML , Hyesoo Yu , david@redhat.com, Michal Hocko , Suren Baghdasaryan , KyongHo Cho , John Dias , Hridya Valsaraju , Sumit Semwal , linux-media , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Christoph Hellwig , Rob Herring , "moderated list:DMA BUFFER SHARING FRAMEWORK" Subject: Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps Message-ID: References: <20210113012143.1201105-1-minchan@kernel.org> <20210113012143.1201105-5-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Tue, Jan 19, 2021 at 10:29:29AM -0800, John Stultz wrote: > On Tue, Jan 12, 2021 at 5:22 PM Minchan Kim wrote: > > > > From: Hyesoo Yu > > > > This patch supports chunk heap that allocates the buffers that > > arranged into a list a fixed size chunks taken from CMA. > > > > The chunk heap driver is bound directly to a reserved_memory > > node by following Rob Herring's suggestion in [1]. > > > > [1] https://lore.kernel.org/lkml/20191025225009.50305-2-john.stultz@linaro.org/T/#m3dc63acd33fea269a584f43bb799a876f0b2b45d > > > > Signed-off-by: Hyesoo Yu > > Signed-off-by: Hridya Valsaraju > > Signed-off-by: Minchan Kim > > --- > ... > > +static int register_chunk_heap(struct chunk_heap *chunk_heap_info) > > +{ > > + struct dma_heap_export_info exp_info; > > + > > + exp_info.name = cma_get_name(chunk_heap_info->cma); > > One potential issue here, you're setting the name to the same as the > CMA name. Since the CMA heap uses the CMA name, if one chunk was > registered as a chunk heap but also was the default CMA area, it might > be registered twice. But since both would have the same name it would > be an initialization race as to which one "wins". Good point. Maybe someone might want to use default CMA area for both cma_heap and chunk_heap. I cannot come up with ideas why we should prohibit it atm. > > So maybe could you postfix the CMA name with "-chunk" or something? Hyesoo, Any opinion? Unless you have something other idea, let's fix it in next version.