Linux-Devicetree Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v4 0/4] Chunk Heap Support on DMA-HEAP
@ 2021-01-21 17:54 Minchan Kim
  2021-01-21 17:54 ` [PATCH v4 1/4] mm: cma: introduce gfp flag in cma_alloc instead of no_warn Minchan Kim
                   ` (3 more replies)
  0 siblings, 4 replies; 31+ messages in thread
From: Minchan Kim @ 2021-01-21 17:54 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, LKML, hyesoo.yu, david, mhocko, surenb, pullip.cho,
	joaodias, hridya, john.stultz, sumit.semwal, linux-media,
	devicetree, hch, robh+dt, linaro-mm-sig, Minchan Kim

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(e.g, 64K) up to several hundred
MB memory.

To make such high-order big bulk allocations work, chunk-heap uses
CMA area. To avoid CMA allocation long stall on blocking pages(e.g.,
page writeback and/or page locking), it uses failfast mode of the
CMA API(i.e., __GFP_NORETRY) so it will continue to find easy
migratable pages in different pageblocks without stalling. At last
resort, it will allow the blocking only if it couldn't find the
available memory in the end.

First two patches introduces the failfast mode as __GFP_NORETRY
in alloc_contig_range and the allow to use it from the CMA API.
Third patch introduces device tree syntax for chunk-heap to bind
the specific CMA area with chunk-heap.
Finally, last patch implements chunk-heap as dma-buf heap.

* since v3 - https://lore.kernel.org/linux-mm/20210113012143.1201105-1-minchan@kernel.org/
  * use prefix for chunk-name - John
  * fix yamllint error - Rob
  * add reviewed-by - Suren

* since v2 - https://lore.kernel.org/linux-mm/20201201175144.3996569-1-minchan@kernel.org/
  * introduce gfp_mask with __GFP_NORETRY on cma_alloc - Michal
  * do not expoert CMA APIs - Christoph
  * use compatible string for DT instead of dma-heap specific property - Hridya

* 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):
  dt-bindings: reserved-memory: Make DMA-BUF CMA heap DT-configurable
  dma-buf: heaps: add chunk heap to dmabuf heaps

Minchan Kim (2):
  mm: cma: introduce gfp flag in cma_alloc instead of no_warn
  mm: failfast mode with __GFP_NORETRY in alloc_contig_range

 .../reserved-memory/dma_heap_chunk.yaml       |  56 ++
 drivers/dma-buf/heaps/Kconfig                 |   8 +
 drivers/dma-buf/heaps/Makefile                |   1 +
 drivers/dma-buf/heaps/chunk_heap.c            | 492 ++++++++++++++++++
 drivers/dma-buf/heaps/cma_heap.c              |   2 +-
 drivers/s390/char/vmcp.c                      |   2 +-
 include/linux/cma.h                           |   2 +-
 kernel/dma/contiguous.c                       |   3 +-
 mm/cma.c                                      |  12 +-
 mm/cma_debug.c                                |   2 +-
 mm/hugetlb.c                                  |   6 +-
 mm/page_alloc.c                               |   8 +-
 mm/secretmem.c                                |   3 +-
 13 files changed, 581 insertions(+), 16 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/reserved-memory/dma_heap_chunk.yaml
 create mode 100644 drivers/dma-buf/heaps/chunk_heap.c

-- 
2.30.0.296.g2bfb1c46d8-goog


^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, back to index

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21 17:54 [PATCH v4 0/4] Chunk Heap Support on DMA-HEAP Minchan Kim
2021-01-21 17:54 ` [PATCH v4 1/4] mm: cma: introduce gfp flag in cma_alloc instead of no_warn Minchan Kim
2021-01-21 18:46   ` David Hildenbrand
2021-01-21 18:50   ` Minchan Kim
2021-01-25 13:07   ` Michal Hocko
2021-01-25 19:42     ` Minchan Kim
2021-01-26  7:38       ` Michal Hocko
2021-01-26 19:12         ` Minchan Kim
2021-01-27 20:21           ` Minchan Kim
2021-01-21 17:55 ` [PATCH v4 2/4] mm: failfast mode with __GFP_NORETRY in alloc_contig_range Minchan Kim
2021-01-25 13:12   ` Michal Hocko
2021-01-25 13:13     ` Michal Hocko
2021-01-25 19:33     ` Minchan Kim
2021-01-26  7:44       ` Michal Hocko
2021-01-26 19:10         ` Minchan Kim
2021-01-27  8:14           ` Michal Hocko
2021-01-27 20:42         ` Minchan Kim
2021-01-28  7:53           ` Michal Hocko
2021-01-28 16:56             ` Minchan Kim
2021-01-21 17:55 ` [PATCH v4 3/4] dt-bindings: reserved-memory: Make DMA-BUF CMA heap DT-configurable Minchan Kim
2021-01-26  7:07   ` John Stultz
2021-01-27 20:25     ` Hridya Valsaraju
2021-02-05 22:55   ` Rob Herring
2021-01-21 17:55 ` [PATCH v4 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps Minchan Kim
2021-01-26  7:07   ` Christoph Hellwig
2021-01-26 19:27     ` Minchan Kim
2021-01-26  7:32   ` John Stultz
2021-01-26 19:24     ` Minchan Kim
2021-01-26  7:46   ` Michal Hocko
2021-01-26 19:25     ` Minchan Kim
2021-01-27  8:09       ` Michal Hocko

Linux-Devicetree Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-devicetree/0 linux-devicetree/git/0.git
	git clone --mirror https://lore.kernel.org/linux-devicetree/1 linux-devicetree/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-devicetree linux-devicetree/ https://lore.kernel.org/linux-devicetree \
		devicetree@vger.kernel.org
	public-inbox-index linux-devicetree

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-devicetree


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git