Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3061974pxb; Tue, 19 Jan 2021 12:44:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJzAfdiI+DRecANqt4uYYOvhv2KUCNmhAPo4NXm4PFHsrakrrY3oxSysk6lR3NSuq0fUJr5U X-Received: by 2002:a17:907:e9e:: with SMTP id ho30mr4215921ejc.529.1611089053913; Tue, 19 Jan 2021 12:44:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611089053; cv=none; d=google.com; s=arc-20160816; b=jTsZPHCHkbLvKVkeBJrEF/vB/RDhHImLHEb/udneusbBLz99D8DoNE58ZDAXX9c8V1 XQzQEZ7LYJ+lNhad+P/skHHCYQR4/TSS1lR9lkd24IZSiUtN7gBVnwZyS3KbOK4vIgBD Is/Jp4IPr3+ARJqwh1H67wusICumLra5bWRCi3ewkQKBI95wgn61l75SWvP706Hp6JhA jYBdIruDUtfqOMIavGFNWbkXoqtCNv+alm2Hf8YRPmPfGsHmWyWYwVxKA2/hdHsoth88 a3kVQUVZWPLh13iHm8xwU+3AM7EelWRQI/EgPjixDByB7AG5yzTqENJgI+0XzkDpubOp OXxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=B8V4SvilY22Ou2CtEY4Ue8qbjrsp3tthnLCK+7Q59QY=; b=nMVUVwHALtd78caAcS1x64/CAsA+C9hdMcebql0qBHUY9+fOeDn2/M3pwEeR3/W8fm /jYVcmwxMwopM3UYGeRd5f6SJ6bPJN+LWa1nOyBdcEG/rxeSGoXQeeOBRtHhH4iryC04 QWwpfMcVRV2QmNQr1ZhqFQ5WZ3YP+4TbAKKjTJyHNTxrV65bvmiSxgSw6rfgeT01heyJ 5oF+S9xuhJHsB9Bcv4MTgTaP0STYHknMcacvbOKigbcnQ4BfppgzZNU9N/O34ISR0xlH vbUjPRQbRm0ZoFJo7D2UL/Tc7Na9TOWpxzjorkIrS5y9PxGtqk6yWt++TMwPn3uXq5YW xsHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PeAXI8eT; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i10si9151975ejd.572.2021.01.19.12.43.48; Tue, 19 Jan 2021 12:44:13 -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=@gmail.com header.s=20161025 header.b=PeAXI8eT; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728255AbhASUjD (ORCPT + 99 others); Tue, 19 Jan 2021 15:39:03 -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-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: linux-kernel@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.