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=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL 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 D42DCC433E0 for ; Wed, 20 Jan 2021 20:53:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2BF1A233FC for ; Wed, 20 Jan 2021 20:53:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2BF1A233FC Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5CA886B0007; Wed, 20 Jan 2021 15:53:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 579B86B0008; Wed, 20 Jan 2021 15:53:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 490356B000A; Wed, 20 Jan 2021 15:53:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id 33E6A6B0007 for ; Wed, 20 Jan 2021 15:53:14 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 038EB8249980 for ; Wed, 20 Jan 2021 20:53:14 +0000 (UTC) X-FDA: 77727353508.14.verse44_1e087072755d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id D168418229835 for ; Wed, 20 Jan 2021 20:53:13 +0000 (UTC) X-HE-Tag: verse44_1e087072755d X-Filterd-Recvd-Size: 5631 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Wed, 20 Jan 2021 20:53:13 +0000 (UTC) Received: by mail-wr1-f43.google.com with SMTP id g10so6007065wrx.1 for ; Wed, 20 Jan 2021 12:53:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+Fzlnu2gDVF5uqigGznocNtk8tICKRhrhDQur+g+6zI=; b=Ap8blQxbIDeY1iMmJMm2T7KYPQi0avue3p1JK+vpgNKrG9yC08Oz5D7lBwGvPTP9o+ 8jSoY81LwRelmRszwF2zG4x520gG/eqyTx5SRcjPWx9fQEEL8US+OLreGcAUFvbReIa3 5mPpM8BlbbIDjxcbZn9XBEXaS1s1aewOvZJVUCyo7FLc57nql3qDt6wJOe7VbiEq8YBQ PU5jZL4IfoLhrHykg9Y0que2Dg9Hi6IDGuhfMik2k4my3sxHlrKVRrV/BXXQqc1inbXa 23MeK88WsAUO0Mtvxb2kHB3hYIvMCKlMrykrS2j4lEX+MME/c9gJuSdIRxBe98rw6C4T aseQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+Fzlnu2gDVF5uqigGznocNtk8tICKRhrhDQur+g+6zI=; b=STvBqme9PpjaKVNJVCQmfpUivpygn1SgwJY8Mr7rXYUhWGnVa4D63V1QIncOXPkIk0 ONxxpb46qkduOoeE1S0mSXk83Gj0NVDlFfue6v/V66ZwZy7nh0kp51rIOl1bprQr4G6F 0wOOrormGmK1eB4cwSLRLougUAq4MR37d/6cOSSUq6qJeSe3sjLAwRUDQjUJrL8QwFug qSh5woyqwB9kuLS0RIBLNxvqUmRM1DecYup7Hi3rkKMoteixRAhSs3UnkmaXAjB59Ga1 sk5IlaqrQiHGOt8TVOL1Uf+YUmWmAsk/TTiPMdihUY4HLTsUL34qgapasQgLQiaW3qlf sKMg== X-Gm-Message-State: AOAM532PfQKXslw7qhmUiFWUnglSiYn/lxNZPArXAiaEYxYi4iLWs1lv WltD2Nph5VbkJ9xejGyJp7zIhf/YH33jpg1kHqQfwQ== X-Google-Smtp-Source: ABdhPJwt7pT74j5UgBuf0hqmfBTKggX4sl1ee2GbnEY6OrFXtj1vnr4AMrVjK/Sb4RohxWtiIk9c6lfylvwXhnh6I2k= X-Received: by 2002:a5d:4704:: with SMTP id y4mr10992455wrq.358.1611175991891; Wed, 20 Jan 2021 12:53:11 -0800 (PST) MIME-Version: 1.0 References: <20210113012143.1201105-1-minchan@kernel.org> <20210113012143.1201105-5-minchan@kernel.org> <20210120033208.GA179511@KEI> In-Reply-To: <20210120033208.GA179511@KEI> From: Suren Baghdasaryan Date: Wed, 20 Jan 2021 12:53:01 -0800 Message-ID: Subject: Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps To: Hyesoo Yu Cc: Minchan Kim , John Stultz , Andrew Morton , linux-mm , LKML , david@redhat.com, Michal Hocko , 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" Content-Type: text/plain; charset="UTF-8" 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, Jan 19, 2021 at 7:39 PM Hyesoo Yu wrote: > > On Tue, Jan 19, 2021 at 12:36:40PM -0800, Minchan Kim wrote: > > 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 After addressing John's comments feel free to add Reviewed-by: Suren Baghdasaryan > > > > --- > > > ... > > > > +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. > > > > I agree that. It is not good to use heap name directly as cma name. > Let's postfix the name with '-chunk' > > Thanks, > Regards.