public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/amdgpu: add VRAM migration infrastructure for drm_pagemap
Date: Sat, 16 May 2026 12:15:37 +1000	[thread overview]
Message-ID: <review-patch1-20260513095734.69598-2-Junhua.Shen@amd.com> (raw)
In-Reply-To: <20260513095734.69598-2-Junhua.Shen@amd.com>

Patch Review

**SPDX comment style:** The `.c` file uses `/* SPDX-License-Identifier: GPL-2.0 OR MIT */` which is the comment style for header files. C source files should use `// SPDX-License-Identifier: GPL-2.0 OR MIT`.

**`drm_pagemap_init` error path leaks resources:**
```c
if (drm_pagemap_init(&svm_dm->dpagemap, pgmap, adev_to_drm(adev),
						&amdgpu_svm_drm_pagemap_ops)) {
	dev_err(adev->dev, "SVM: failed to init drm_pagemap\n");
	return -EINVAL;
}
```
If `drm_pagemap_init()` fails, the `devm_memremap_pages()` registration is not unwound. While devres will eventually clean it up at device teardown, the function has already registered ZONE_DEVICE pages that will have no functional `drm_pagemap` backing — this is a window for use-after-free if the SVM paths try to use them. The error path should call `devm_memunmap_pages()` or equivalent, similar to the `IS_ERR(r)` path above it.

**Alignment in `drm_pagemap_init` call:**
```c
if (drm_pagemap_init(&svm_dm->dpagemap, pgmap, adev_to_drm(adev),
						&amdgpu_svm_drm_pagemap_ops)) {
```
The continuation line has excessive indentation (tabs to column ~40). Align to the opening parenthesis or use a single extra tab.

**`amdgpu_amdkfd.h` include removed but no explanation:** The diff removes `#include "amdgpu_amdkfd.h"` from the includes. Patch 2 replaces the include list entirely, so this is fine functionally, but it's an artifact of the patch split — patch 1 adds the file, patch 2 rewrites the includes. The original file in patch 1 never needed this include in the first place (nothing from amdkfd is used), so this is just slightly messy.

**`amdgpu_svm_page_to_apagemap` is defined but unused in this patch.** It's used later in patch 2. This is minor but could trigger a compiler warning depending on config.

**Double blank line** at line 291 (between `amdgpu_svm_page_to_apagemap` and `amdgpu_svm_drm_pagemap_ops`).

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-16  2:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13  9:57 [PATCH v4 0/6] drm/amdgpu: SVM VRAM migration via drm_pagemap (XNACK-on) Junhua Shen
2026-05-13  9:57 ` [PATCH v4 1/6] drm/amdgpu: add VRAM migration infrastructure for drm_pagemap Junhua Shen
2026-05-16  2:15   ` Claude Code Review Bot [this message]
2026-05-13  9:57 ` [PATCH v4 2/6] drm/amdgpu: implement drm_pagemap SDMA migration callbacks Junhua Shen
2026-05-16  2:15   ` Claude review: " Claude Code Review Bot
2026-05-13  9:57 ` [PATCH v4 3/6] drm/amdgpu: implement synchronous TTM eviction for SVM BOs Junhua Shen
2026-05-16  2:15   ` Claude review: " Claude Code Review Bot
2026-05-13  9:57 ` [PATCH v4 4/6] drm/amdgpu: add SVM range migration helpers for drm_pagemap Junhua Shen
2026-05-16  2:15   ` Claude review: " Claude Code Review Bot
2026-05-13  9:57 ` [PATCH v4 5/6] drm/amdgpu: hook up ZONE_DEVICE registration in device init and reset Junhua Shen
2026-05-13 13:47   ` Christian König
2026-05-14  7:33     ` Junhua Shen
2026-05-16  2:15   ` Claude review: " Claude Code Review Bot
2026-05-13  9:57 ` [PATCH v4 6/6] drm/amdgpu: integrate VRAM migration into SVM range map and fault paths Junhua Shen
2026-05-16  2:15   ` Claude review: " Claude Code Review Bot
2026-05-16  2:15 ` Claude review: drm/amdgpu: SVM VRAM migration via drm_pagemap (XNACK-on) Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-04-27 10:05 [PATCH v3 0/5] drm/amdgpu: SVM VRAM migration via drm_pagemap Junhua Shen
2026-04-27 10:05 ` [PATCH v3 1/5] drm/amdgpu: add VRAM migration infrastructure for drm_pagemap Junhua Shen
2026-04-28  4:43   ` 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-20260513095734.69598-2-Junhua.Shen@amd.com \
    --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