From patchwork Tue Nov 17 18:19:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minchan Kim X-Patchwork-Id: 11913189 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=-6.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no 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 049FBC2D0E4 for ; Tue, 17 Nov 2020 18:19:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6FFBD221FD for ; Tue, 17 Nov 2020 18:19:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Sm8gsGQ6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FFBD221FD 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 E6EDE6B0036; Tue, 17 Nov 2020 13:19:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DEDD66B005C; Tue, 17 Nov 2020 13:19:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C2CD96B0068; Tue, 17 Nov 2020 13:19:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0203.hostedemail.com [216.40.44.203]) by kanga.kvack.org (Postfix) with ESMTP id 8A97A6B0036 for ; Tue, 17 Nov 2020 13:19:46 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2FE99362A for ; Tue, 17 Nov 2020 18:19:46 +0000 (UTC) X-FDA: 77494723572.13.art35_2809fd327333 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 1172518140B60 for ; Tue, 17 Nov 2020 18:19:46 +0000 (UTC) X-HE-Tag: art35_2809fd327333 X-Filterd-Recvd-Size: 5209 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Tue, 17 Nov 2020 18:19:45 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id y22so10683662plr.6 for ; Tue, 17 Nov 2020 10:19:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=W4I19oM9+fyOJfOvcvDY/AN8UbFYUGaHDs6FnXuBEh4=; b=Sm8gsGQ6sXByMdxzxKKwQ5tNLq0ka4tzSJISjO0jblHbyKIUxo102IB7T0ECEZdpMV mBfiSnf6KZ03+xSBxN4iW7u4+xT5z3hHdW5m2+J0IC71ME+4BbjDlLh4JUowu7HMsWSu fedZdo5y5aO+75GsLQgY00nkMk1W8B1rC9NUistS4OYcywhRtamPafloZbBZScOm4ZG7 zvMWFru8RK8WXo4xN6uPN9yHtn5YZfQih+FB+SAFp4M7ZFUV3hDruP47j05MC/hqY2K/ KjHDZT1sRS+fm+P/XVpurDyy2mbDIo0jy6nXVwVQl5JJr91ti8uOK3sPl4BwGkfzMama UiVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=W4I19oM9+fyOJfOvcvDY/AN8UbFYUGaHDs6FnXuBEh4=; b=bjCJRLcQPVY7z28Jt3P3vMDOQrU97Ju9Z4bb3QXdpDJGsT0QU8YL3MZQkTYz1+sY2x i9EHOhOQYjsCyZnA7iK9Flv+ALZJQHRaen4rbud3J9/3TRC2YHVNaOsVbiTMFd5D5Taq Nh/Kt+HSGMU2ZG7eAwQzjMY3c90zZqX+UGIS3Dw/UQ6ED7lAfr/7tbKMO/K3gtDAXA2O r28Nd3jzt67aUESrXE3XCDe+ZlXFt6fZmfdXqNvcH2dZ1UhJkJ293Ue6r3+ehFSvbBW7 OvR0jLwq/q9qpzOsFG6oP1RI43YmfhKZAFsNjA3IFEOLd09laK8uCVXO29/43iEi3mnK oQhA== X-Gm-Message-State: AOAM533YXgMaJ4eKFih5wd0ZNQCV+xrcjI3YGVES+N/YTzREwLR20Eiy hCZ9I1pv0xL1JmXEQvmBlAU= X-Google-Smtp-Source: ABdhPJxWMVJ5fUs0GD9esnodGnS80SKZIX7p7AYpiidE9Zy2i3xr/EAZJDacnYgj2ta4ILI72Jy82A== X-Received: by 2002:a17:90a:d486:: with SMTP id s6mr312042pju.115.1605637184416; Tue, 17 Nov 2020 10:19:44 -0800 (PST) Received: from bbox-1.mtv.corp.google.com ([2620:15c:211:201:7220:84ff:fe09:5e58]) by smtp.gmail.com with ESMTPSA id h8sm4302639pjc.54.2020.11.17.10.19.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 10:19:43 -0800 (PST) From: Minchan Kim To: Andrew Morton Cc: LKML , linux-mm , hyesoo.yu@samsung.com, willy@infradead.org, david@redhat.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, surenb@google.com, pullip.cho@samsung.com, joaodias@google.com, hridya@google.com, sumit.semwal@linaro.org, john.stultz@linaro.org, Brian.Starkey@arm.com, linux-media@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, christian.koenig@amd.com, linaro-mm-sig@lists.linaro.org, Minchan Kim Subject: [PATCH 0/4] Chunk Heap Support on DMA-HEAP Date: Tue, 17 Nov 2020 10:19:31 -0800 Message-Id: <20201117181935.3613581-1-minchan@kernel.org> X-Mailer: git-send-email 2.29.2.299.gdc1121823c-goog MIME-Version: 1.0 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: This patchset introduces a new dma heap, chunk heap that makes it easy to perform the bulk allocation of high order pages. It has been created to help optimize the 4K/8K HDR video playback with secure DRM HW to protect contents on memory. The HW needs physically contiguous memory chunks up to several hundred MB memory. The chunk heap is registered by device tree with alignment and memory node of Contiguous Memory Allocator(CMA). Alignment defines chunk page size. For example, alignment 0x1_0000 means chunk page size is 64KB. The phandle to memory node indicates contiguous memory allocator(CMA). If device node doesn't have cma, the registration of chunk heap fails. This patchset is against on next-20201110. The patchset includes the following: - cma_alloc_bulk API - export dma-heap API to register kernel module dma heap. - add chunk heap implementation. - devicetree Hyesoo Yu (3): dma-buf: add export symbol for dma-heap dma-buf: heaps: add chunk heap to dmabuf heaps dma-heap: Devicetree binding for chunk heap Minchan Kim (1): mm: introduce cma_alloc_bulk API .../bindings/dma-buf/chunk_heap.yaml | 52 ++ drivers/dma-buf/dma-heap.c | 2 + drivers/dma-buf/heaps/Kconfig | 9 + drivers/dma-buf/heaps/Makefile | 1 + drivers/dma-buf/heaps/chunk_heap.c | 458 ++++++++++++++++++ include/linux/cma.h | 5 + include/linux/page-isolation.h | 1 + mm/cma.c | 129 ++++- mm/page_alloc.c | 19 +- mm/page_isolation.c | 3 +- 10 files changed, 666 insertions(+), 13 deletions(-) create mode 100644 Documentation/devicetree/bindings/dma-buf/chunk_heap.yaml create mode 100644 drivers/dma-buf/heaps/chunk_heap.c