From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: dma: contiguous: Turn heap registration logic around
Date: Fri, 27 Feb 2026 13:12:02 +1000 [thread overview]
Message-ID: <review-patch1-20260225-dma-buf-heaps-as-modules-v1-1-2109225a090d@kernel.org> (raw)
In-Reply-To: <20260225-dma-buf-heaps-as-modules-v1-1-2109225a090d@kernel.org>
Patch Review
This is the key architectural change. It moves the CMA reserved-region tracking from `cma_heap.c` into `kernel/dma/contiguous.c` and provides an iterator `dma_contiguous_get_reserved_region()` for the heap to use.
**Positive:**
- Clean inversion of the dependency. The old `dma_heap_cma_register_heap()` called from `contiguous.c` into heap code; now the heap calls into `contiguous.c`. This correctly eliminates the built-in-to-module dependency.
- Proper `!CONFIG_DMA_CMA` stub provided in `dma-map-ops.h`.
- `EXPORT_SYMBOL_GPL` used appropriately.
**Issue - `rmem_cma_areas` is no longer `__initdata`:**
```c
+static struct cma *rmem_cma_areas[MAX_CMA_AREAS];
+static unsigned int rmem_cma_areas_num;
```
The old `dma_areas` in `cma_heap.c` was marked `__initdata`, meaning it was discarded after init. The new `rmem_cma_areas` in `contiguous.c` is *not* marked `__initdata` -- and correctly so, because a module could be loaded after init. However, this means `MAX_CMA_AREAS` worth of pointers now persist for the lifetime of the kernel. This is intentional and correct for module support, but worth noting in the commit message.
**Minor - no locking on `rmem_cma_areas`:**
`rmem_cma_insert_area()` is called from `__init` context (`rmem_cma_setup`), and `dma_contiguous_get_reserved_region()` is called from `module_init`. Since all inserts happen during early boot (before modules load), there's no real race. This is fine.
**Nit:** The function name `dma_contiguous_get_reserved_region` is a good choice and follows the existing naming convention in `contiguous.c`.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-02-27 3:12 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 16:41 [PATCH 0/7] dma-buf: heaps: Turn heaps into modules Maxime Ripard
2026-02-25 16:41 ` [PATCH 1/7] dma: contiguous: Turn heap registration logic around Maxime Ripard
2026-02-25 19:32 ` T.J. Mercier
2026-02-27 3:12 ` Claude Code Review Bot [this message]
2026-02-25 16:41 ` [PATCH 2/7] mm: cma: Export cma_alloc and cma_release Maxime Ripard
2026-02-25 19:34 ` T.J. Mercier
2026-02-26 10:25 ` David Hildenbrand (Arm)
2026-02-26 10:38 ` Maxime Ripard
2026-02-26 10:49 ` David Hildenbrand (Arm)
2026-02-26 16:58 ` T.J. Mercier
2026-02-27 3:12 ` Claude review: " Claude Code Review Bot
2026-02-25 16:41 ` [PATCH 3/7] mm: cma: Export cma_get_name Maxime Ripard
2026-02-25 19:34 ` T.J. Mercier
2026-02-27 3:12 ` Claude review: " Claude Code Review Bot
2026-02-25 16:41 ` [PATCH 4/7] mm: cma: Export dma_contiguous_default_area Maxime Ripard
2026-02-25 19:52 ` T.J. Mercier
2026-02-27 3:12 ` Claude review: " Claude Code Review Bot
2026-02-25 16:41 ` [PATCH 5/7] dma-buf: heaps: Export mem_accounting parameter Maxime Ripard
2026-02-25 19:53 ` T.J. Mercier
2026-02-27 3:12 ` Claude review: " Claude Code Review Bot
2026-02-25 16:41 ` [PATCH 6/7] dma-buf: heaps: cma: Turn the heap into a module Maxime Ripard
2026-02-25 19:54 ` T.J. Mercier
2026-02-27 3:12 ` Claude review: " Claude Code Review Bot
2026-02-25 16:41 ` [PATCH 7/7] dma-buf: heaps: system: " Maxime Ripard
2026-02-25 19:55 ` T.J. Mercier
2026-02-27 3:12 ` Claude review: " Claude Code Review Bot
2026-02-25 18:51 ` [PATCH 0/7] dma-buf: heaps: Turn heaps into modules John Stultz
2026-02-26 10:18 ` Maxime Ripard
2026-02-26 18:03 ` John Stultz
2026-02-27 3:12 ` Claude review: " Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-03-03 10:13 [PATCH v3 0/8] " Maxime Ripard
2026-03-03 10:13 ` [PATCH v3 1/8] dma: contiguous: Turn heap registration logic around Maxime Ripard
2026-03-03 21:41 ` Claude review: " Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-patch1-20260225-dma-buf-heaps-as-modules-v1-1-2109225a090d@kernel.org \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox