Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2983937pxb; Tue, 19 Jan 2021 10:34:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPMhdL8y0HDr5WjA3yWT1P74EmNtjr9QAm4/Kmlp7Hg4cV2vkpuq4jsqdZ7XVgQVxNeRVJ X-Received: by 2002:a17:907:c01:: with SMTP id ga1mr3704684ejc.488.1611081285569; Tue, 19 Jan 2021 10:34:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611081285; cv=none; d=google.com; s=arc-20160816; b=gBBEirSe8bLSYjYwLk+ByiB6vcHMVwJTJoJTH2Y0uagRN2D3Tv0EC9GJD3L2XfcxLm Nh7c48tQcWeR+zuPLCYM8ByibdLF2s4PeljgZ+5fJ3os4AkcqBCdsFPgO+zezZNdwwun LjVKE7xkcwO5R/b+Dn/lhapDqEH8xr60K1+t3CuEEa33aQst0Cu002JEISAjzfA8Tfxa FO1TFt0Nzp31X/csGd1QKE4Cm3jDTR6+R4S/8Y5FFEMnDs1E2FPbTtwhceJZJElj/yla CO8SNblJsqwim0tkWyf7u81cAsBPgZw64xHiRqLrDUnbjBA2oXqMRKNeWpSjak0CtjDO LC2w== 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=JWWYuzWaghP5Q544uqJbXr3wVFNCkeCk1gyHHkDdQ/A=; b=l7QmxmYDrrXF6ad1R7kVwhMgWxmrWkzGFOvRJxUkO8C2jVxZUh1t5AsVzkTTUYioRp eK/K/ekoN1qNYA/NtWqglWmt/50yLB2xgZZGuc7IqkTDfjOJsylcD001S5qbbVudQKct o3ySldVFYAV0ngIwUmSf4QLxDBkSVdjHihIRBtoSOnMC35chj0OyqtvI5hZP40i6e2ux iE75oBth33H4byWHzKYIDTjDd4ezB6Zqat+ELI/N8IRM8v/ze9SJxEbsUbNLOTprpkAQ atqYABBhCwTeL8zuN/NMdS8wttyjz10o4XoamF84nzgMM/MRoBfvVrywvMp8NeBkT1YF paBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xnRYIRj8; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si6532271ejp.464.2021.01.19.10.34.16; Tue, 19 Jan 2021 10:34:45 -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=@linaro.org header.s=google header.b=xnRYIRj8; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389995AbhASScB (ORCPT + 99 others); Tue, 19 Jan 2021 13:32:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727078AbhASSaW (ORCPT ); Tue, 19 Jan 2021 13:30:22 -0500 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7FD5C061573 for ; Tue, 19 Jan 2021 10:29:41 -0800 (PST) Received: by mail-lj1-x235.google.com with SMTP id f17so23016139ljg.12 for ; Tue, 19 Jan 2021 10:29:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JWWYuzWaghP5Q544uqJbXr3wVFNCkeCk1gyHHkDdQ/A=; b=xnRYIRj8nrXC1Xt9zSBJsXJhgrBfjtCh3CpB6YoNFq2VStdTH5p5X55ThbO9d1T1QX W4s3X+eaII0u/7aakfdFOHqfMiUcebQtCqGbU6qrTrTIw/bmaobbAmF5g8xQdlH+JcMm MwOW3qhK6j4IEuDDA9aUNzDZHWOBV902OvyIedTiWvaRgws3zCpOuRkUoF7aUpFxFq3D 40LMffLZW2m8ILnF63bEftJER/hfJVcH/wFwzdFaBuEzghmJBC93E7qNrD9P7KluZaeX XSeU0f3WfA72mJTI8MrG5TUXjTsupJjNWOUFcePRC+6ucYsae6rZqQivHGipbnhG0lhg MmZA== 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=JWWYuzWaghP5Q544uqJbXr3wVFNCkeCk1gyHHkDdQ/A=; b=SnB7oMP+IvYkuhxUlGH4daGMQZfPMz5v7sBHx+Y9eLYjpVhthSy9E9SHucbJi6deP2 GlXsZR0Za6Gfx5b3aEmWm8DSlG7qqsnj9z2X81PRXSI7baLpcVsKxtoZrkskMlhIltPk DktYiVoizdQS3KP378x8+U8SYX9slEyKGr3rPxRpEz05FNUtZIIWwpmvnC6+pGjqcP0t ydXEFYEJ3QI+aWYBThjqIglwzsTZmHjfFJ/WDZs8KqRq9uUYI191mIb/j76bhEBpsBO9 4spM8GQnf2fldx5iHaYCE1yD9SNsLJuxsLT6KEGOSEkYjH1NPLGx2T6gO+sRp701hQNS oT/A== X-Gm-Message-State: AOAM5326QWFzrRcqiGBxFMaNG8fNmQcTHsrw0c8SA14LumSBLL0+nEXA U8Sy2/m7H2gkybihMFPhtpTNG5m1uiw5sgLgoWvjqA== X-Received: by 2002:a05:651c:10e:: with SMTP id a14mr2543204ljb.128.1611080980220; Tue, 19 Jan 2021 10:29:40 -0800 (PST) MIME-Version: 1.0 References: <20210113012143.1201105-1-minchan@kernel.org> <20210113012143.1201105-5-minchan@kernel.org> In-Reply-To: <20210113012143.1201105-5-minchan@kernel.org> From: John Stultz Date: Tue, 19 Jan 2021 10:29:29 -0800 Message-ID: Subject: Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps To: Minchan Kim 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" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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". So maybe could you postfix the CMA name with "-chunk" or something? thanks -john