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=-14.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 1BD55C433DB for ; Fri, 5 Feb 2021 22:56:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7C40564FEB for ; Fri, 5 Feb 2021 22:55:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C40564FEB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C899F6B0006; Fri, 5 Feb 2021 17:55:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C5F766B006C; Fri, 5 Feb 2021 17:55:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B4DEA6B006E; Fri, 5 Feb 2021 17:55:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0147.hostedemail.com [216.40.44.147]) by kanga.kvack.org (Postfix) with ESMTP id 9FB1D6B0006 for ; Fri, 5 Feb 2021 17:55:58 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 71E843635 for ; Fri, 5 Feb 2021 22:55:58 +0000 (UTC) X-FDA: 77785723596.12.toe46_0d140a5275e8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 603F918005B00 for ; Fri, 5 Feb 2021 22:55:58 +0000 (UTC) X-HE-Tag: toe46_0d140a5275e8 X-Filterd-Recvd-Size: 6198 Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Fri, 5 Feb 2021 22:55:57 +0000 (UTC) Received: by mail-ot1-f51.google.com with SMTP id 100so1788330otg.3 for ; Fri, 05 Feb 2021 14:55:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=A/9Ih9622NVTzrZPwCYg0qngEXggsHsaO2OKN20W6PE=; b=Hgl/wb5LKzmahga+skreDFmaCRU4bdk+JqlgsM6/OyQwhU/66f4MFsmAlpyFel8g6f 0VWmGeEcEGC4WisF0H5hKcd3XdkOm1fPcK4sjvU5dldTX4EcjWZIZHaVksizG2sRMC6/ D+Yf9s0RZ2A3jnQQM5eoYrFwuDhV0J+UeSYplzLRvChYILzqwlmkonOZhN68SJOva44t iAvgozrgSnr4I8gkE8u3oYnO/PzWmyvH3v6E7UCpJupQmwI2Cz62nFwYqf20Gzg2ZmbP 2Wc/ZFhgEVCAKEBkwnHJ5KdAbwuNmSyTM0loPvIHjWS61kML28lqrJ2Zh3RDrWopFwSq aA5w== X-Gm-Message-State: AOAM530BUVtF9cvTLazGKnyvG4QdeotSRZ6C8PZNPAJ22K7hxM4rSA5b DWdx3NzBPCCguUSzBJeXqA== X-Google-Smtp-Source: ABdhPJyOibYhklMZaYhw1NqTq4B3G/M82Lf2xbPpvAKKblvYXBpctsn3mrDEoKTpEDRl2i/3LBnClQ== X-Received: by 2002:a9d:7699:: with SMTP id j25mr4952858otl.202.1612565757307; Fri, 05 Feb 2021 14:55:57 -0800 (PST) Received: from robh.at.kernel.org (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id q8sm1403961oth.65.2021.02.05.14.55.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:55:56 -0800 (PST) Received: (nullmailer pid 3912199 invoked by uid 1000); Fri, 05 Feb 2021 22:55:54 -0000 Date: Fri, 5 Feb 2021 16:55:54 -0600 From: Rob Herring To: Minchan Kim Cc: Andrew Morton , linux-mm , LKML , hyesoo.yu@samsung.com, david@redhat.com, mhocko@suse.com, surenb@google.com, pullip.cho@samsung.com, joaodias@google.com, hridya@google.com, john.stultz@linaro.org, sumit.semwal@linaro.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, hch@infradead.org, linaro-mm-sig@lists.linaro.org Subject: Re: [PATCH v4 3/4] dt-bindings: reserved-memory: Make DMA-BUF CMA heap DT-configurable Message-ID: <20210205225554.GA3881594@robh.at.kernel.org> References: <20210121175502.274391-1-minchan@kernel.org> <20210121175502.274391-4-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210121175502.274391-4-minchan@kernel.org> 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 Thu, Jan 21, 2021 at 09:55:01AM -0800, Minchan Kim wrote: > From: Hyesoo Yu > > Document devicetree binding for chunk cma heap on dma heap framework. > > The DMA chunk heap supports the bulk allocation of higher order pages. > > The chunk heap's allocator allocates from the CMA area. It is optimized > to perform bulk allocation of higher order pages in an efficient manner. > For this purpose, the heap needs an exclusive CMA area that will only be > used for allocation by the heap. This is the reason why we need to use > the DT to create and configure a reserved memory region for use by the > chunk CMA heap driver. Since all allocation from DMA-BUF heaps happen > from the user-space, there is no other appropriate device-driver that > we can use to register the chunk CMA heap and configure the reserved > memory region for its use. LWN tells me we don't need carve outs any more[1]: "CMA now relies on compaction and no longer uses a carved-out memory region." So why do we need this? [1] https://lwn.net/Articles/839216/ > > Signed-off-by: Hyesoo Yu > Signed-off-by: Minchan Kim > Signed-off-by: Hridya Valsaraju > --- > .../reserved-memory/dma_heap_chunk.yaml | 56 +++++++++++++++++++ > 1 file changed, 56 insertions(+) > create mode 100644 Documentation/devicetree/bindings/reserved-memory/dma_heap_chunk.yaml > > diff --git a/Documentation/devicetree/bindings/reserved-memory/dma_heap_chunk.yaml b/Documentation/devicetree/bindings/reserved-memory/dma_heap_chunk.yaml > new file mode 100644 > index 000000000000..00db0ae6af61 > --- /dev/null > +++ b/Documentation/devicetree/bindings/reserved-memory/dma_heap_chunk.yaml > @@ -0,0 +1,56 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/reserved-memory/dma_heap_chunk.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Device tree binding for chunk heap on DMA HEAP FRAMEWORK > + > +description: | > + The DMA chunk heap is backed by the Contiguous Memory Allocator (CMA) and > + supports bulk allocation of fixed size pages. > + > +maintainers: > + - Hyesoo Yu > + - John Stultz > + - Minchan Kim > + - Hridya Valsaraju > + > + > +properties: > + compatible: > + enum: > + - dma_heap,chunk Convention is vendor,thing and 'dma_heap' is not a vendor. Also, '-' is preferred over '_'. > + > + chunk-order: > + description: | > + order of pages that will get allocated from the chunk DMA heap. Page size depends on Linux configuration. And 'order' is very much a Linuxism. > + maxItems: 1 > + > + size: > + maxItems: 1 > + > + alignment: > + maxItems: 1 > + > +required: > + - compatible > + - size > + - alignment > + - chunk-order > + > +additionalProperties: false > + > +examples: > + - | > + reserved-memory { > + #address-cells = <2>; > + #size-cells = <1>; > + > + chunk_memory: chunk_memory { > + compatible = "dma_heap,chunk"; > + size = <0x3000000>; > + alignment = <0x0 0x00010000>; > + chunk-order = <4>; > + }; > + }; > -- > 2.30.0.296.g2bfb1c46d8-goog >