Claude review: Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap

Claude Code Review Bot
2026-04-12T02:09:34Z

Overall Series Review

Subject: Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap
Author: Matthew Brost <matthew.brost@intel.com>
Patches: 8
Reviewed: 2026-04-12T12:09:34.814166

---

This v6 series converts DRM GPU SVM and DRM pagemap migration paths to use the newer `dma_iova_try_alloc` / `dma_iova_link` / `dma_iova_sync` API instead of individual `dma_map_page` / `dma_unmap_page` calls, avoiding costly per-page IOMMU synchronizations. The claimed performance improvement is significant (~33% reduction in 2M migration CPU time).

The series is well-structured: patch 1 handles GPU SVM independently, patches 2-3 prepare the pagemap code (removing a dead flag, splitting a function), patch 4 adds IOVA support to pagemap, and patch 5 is a trivial doc fix. The progression is logical and each patch is reviewable on its own.

The fallback pattern using `dma_iova_try_alloc` (try, check `dma_use_iova()`, fall back to `dma_map_page`) follows the same idiom used by block layer and RDMA callers. Error paths and cleanup look correct throughout.

**Key concerns:**
- The `phys` parameter passed to `dma_iova_try_alloc` is misleading/useless (see patches 1 and 4).
- A stale `@dma_addr` reference in kerneldoc is introduced in patch 3 and not fixed by patch 5.
- IOVA is over-allocated when NULL pages exist in the pfn array (minor waste, not a bug).

Overall this looks ready with minor nits. No correctness issues found.

---

---
Generated by Claude Code Patch Reviewer