From patchwork Tue Dec 1 17:51:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minchan Kim X-Patchwork-Id: 11943431 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=-11.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT 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 31B98C64E7A for ; Tue, 1 Dec 2020 17:51:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 92BD520639 for ; Tue, 1 Dec 2020 17:51:52 +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="ok8kPmCe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92BD520639 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 AF0B96B005D; Tue, 1 Dec 2020 12:51:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A7B1D8D0002; Tue, 1 Dec 2020 12:51:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 91B488D0001; Tue, 1 Dec 2020 12:51:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0113.hostedemail.com [216.40.44.113]) by kanga.kvack.org (Postfix) with ESMTP id 76F4F6B005D for ; Tue, 1 Dec 2020 12:51:51 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 359E3181AEF1A for ; Tue, 1 Dec 2020 17:51:51 +0000 (UTC) X-FDA: 77545456422.15.camp50_10087cb273ac Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 0DB3F1814B0C1 for ; Tue, 1 Dec 2020 17:51:51 +0000 (UTC) X-HE-Tag: camp50_10087cb273ac X-Filterd-Recvd-Size: 4851 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Tue, 1 Dec 2020 17:51:50 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id b23so1535494pls.11 for ; Tue, 01 Dec 2020 09:51:50 -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=k6Xb9MXJVov2wm4juOQ7YbGN8C26NDDinzdyjfuUn68=; b=ok8kPmCe3llCdZTU47fe5dTRRP4u7SG0gPPLUr2FUD806/GcKfVnyVsXgjOcHewNr+ HyXZhRjFiu/IiaCWgjBO9ZzsSRBlNKSpulVhiKziCzQE1zVHBtkA65QRS4vcFapPlgdV UHr/eS5gxALc3bwXwsHfokAxLWuAgCiHpV/GvnmRaQFqNT3PSh3/nr/bOr+OyzkwF40J 3zWpu/RmaSvX+e/hYV+ucNN8qJyaEGDDkErBfGTm/8wXLDNg+c3gFVkxe5UyGeqkT8id ITmSl/ToKZiudo/F2EiSj/L9nY/6I8Lw3gnV9d0dvyFwfFeIsOpoO9t7LuBoo/qMkZUH sF8g== 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=k6Xb9MXJVov2wm4juOQ7YbGN8C26NDDinzdyjfuUn68=; b=nxqoRS4Tjkb3IPEFyGZQHT/BI79C0mODcY/LlY3Sor+bLZXZHCkiscrXJOJalopvTf Xta9Rij/U4dn6G9vSJGQPbI0YFXnEoCvumRlHxblmquiHSX74unGh+fYJMpcLvnKcqmq pKS26l1ZoukSd5aCgM/XpHgOqPNlAMEZqByyy4RTtmnXW4ocmcVSOfDOCc6IDBo9OkSC 3sIO14wvCTuaSbQTOxyMyQGAwErKur8r3etBuVZMzY1tO4ue91lNGytBf+oICzYkpFMe 0QWep4uv7N3SKO0swOMXMQHqgRCqOGLJQO0dk9ZpoAAn6EpUo+4QvtbmT4pptjzjfAxZ PvQQ== X-Gm-Message-State: AOAM533CkL7PTGC0Vd7GScXCEFFm4RkJLDbSlejsaGAmgTDOlmsC5CTN gXRq9Ssx0WdwHqCql6Ry36Y= X-Google-Smtp-Source: ABdhPJzSmx8SXb+o8aTUE2sD5HDesL5BsQaDTaF4cLIZmuGSDBxGOhBU7W0xvz5ruGhxvmVGYiktuw== X-Received: by 2002:a17:90a:c257:: with SMTP id d23mr3934185pjx.211.1606845109590; Tue, 01 Dec 2020 09:51:49 -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 q23sm390082pfg.192.2020.12.01.09.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 09:51:48 -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 v2 0/4] Chunk Heap Support on DMA-HEAP Date: Tue, 1 Dec 2020 09:51:40 -0800 Message-Id: <20201201175144.3996569-1-minchan@kernel.org> X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-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. This patchset is against on next-20201130. The patchset includes the following: - cma_alloc_bulk API - export dma-heap API to register kernel module dma heap. - add chunk heap implementation. * Since v1 - https://lore.kernel.org/linux-mm/20201117181935.3613581-1-minchan@kernel.org/ * introduce alloc_contig_mode - David * use default CMA instead of device tree - John Hyesoo Yu (2): dma-buf: add export symbol for dma-heap dma-buf: heaps: add chunk heap to dmabuf heaps Minchan Kim (2): mm: introduce alloc_contig_mode mm: introduce cma_alloc_bulk API drivers/dma-buf/dma-heap.c | 2 + drivers/dma-buf/heaps/Kconfig | 15 + drivers/dma-buf/heaps/Makefile | 1 + drivers/dma-buf/heaps/chunk_heap.c | 429 +++++++++++++++++++++++++++++ drivers/virtio/virtio_mem.c | 2 +- include/linux/cma.h | 5 + include/linux/gfp.h | 10 +- kernel/dma/contiguous.c | 1 + mm/cma.c | 134 ++++++++- mm/page_alloc.c | 25 +- 10 files changed, 607 insertions(+), 17 deletions(-) create mode 100644 drivers/dma-buf/heaps/chunk_heap.c