Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp650064pxb; Wed, 20 Jan 2021 17:17:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxu7zxzOleHyk/DV4EK2Q69R0suWDhbI4BhtGOaWNAVsS4fhTKo5Tb29Td22obkVRHzFz4K X-Received: by 2002:a05:6402:17cb:: with SMTP id s11mr8947500edy.119.1611191821906; Wed, 20 Jan 2021 17:17:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611191821; cv=none; d=google.com; s=arc-20160816; b=a0N5y1FrkDG1I1LLw5eSkGcGIfuPbPmMhUXNzrp7JJ9PG0ARz9plkFuFguPEhIWfYg 4tfeLfhZ07YF56plHMTnRxMV/U2ezR2zikp2bpuZnW9VtTBGBtGfz5ACuzEmNjacdvIF KyObtsJRuljXFoTxonPInB+omivb90mUAVHtdpZeTbFG9ZwZdbjAV09wq7whtwEcUFCn ZAny1EN4Ea3XPwrgZHQEaKHrcUsFK2MwBUG+mdSCWZPRqu4DFGVdmCL+YK5Cb2L2WO98 oIkYE+lpT6bsYiDtYOBSGVQo5z9vscy/lGhry23soFfnWSFxX9NYm0/2QyRreVDN8J7+ 6yBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=+Fzlnu2gDVF5uqigGznocNtk8tICKRhrhDQur+g+6zI=; b=l0mmNMcWl01lvIWGUcOl5unyf3D5TMmzQmWYBs/+vJyNRwA146dvJOVM5ZTokfB0Ts KyKVKk7YbeEU3ZPVimBummj8zLb2EbjCu1tF0172wAnDt6Kh9J/cqAK9ANXV1Ww3JOyi U9lYAyg/OR7gg3jICV5bkTK4iknUCbfs8p9AjLFUpD90KXVt9bH07yKTIe6tMXe47kqO ASZCPnIGB9/tIu2nHxUzTXrTVT7mBIsKZ2mo5mrTu1O3xa8cEZMJaZviUnPAyy7OuA0E x1xwNJWF5RRcg1nsZKY4L7gUzX1Urt4K/zdVWbC4AzV9X/4BjeWBJ4Q6HhLnoqI9pLEI MKmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Ap8blQxb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs15si1249267ejb.717.2021.01.20.17.16.38; Wed, 20 Jan 2021 17:17:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Ap8blQxb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436662AbhATU7e (ORCPT + 99 others); Wed, 20 Jan 2021 15:59:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389908AbhATUxx (ORCPT ); Wed, 20 Jan 2021 15:53:53 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45565C061757 for ; Wed, 20 Jan 2021 12:53:13 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id a1so3081877wrq.6 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=nAnxBIInciTiYhhSK6pff10kYiaA/qK7iET4tiEc/XCir10enLpxepFZLZPy2NC+sw a+witEYAewGN/BPH9vkj+8R3EAVdmQqERjxbJ9hQtqRSlxdQr/v3oO2uyiE0eFwKgi3x EmAjUcPgUix9CKblXuv9qN9w5ba8ccwStSMHsnMPTUKVRi3Rjrn3VPcyQkPU1ZfRJgQd R4gAYkSs5MnQTnTsFH6rTbOTgg4eaGeNfpVNjNqXhAe7oIQtRuBjJOP9RS9waGI5dytU zXt6afeO4m4hMOOT7E9pRSPA6K6JVqfnWcr9uZifIdCyuiw0MCROiTyJkEtacCnMygE1 oWCQ== X-Gm-Message-State: AOAM533kcMyEfm7Kz/XbkyirTTBoHNAsa69nIrcr4FJxrBtmMpFSKhIj R6cGQjLXup+qgUQ/60HnzkWSyE5y2Dpc783V6w+03g== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.