From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: igt_dmem_driver: add amdgpu support
Date: Sat, 16 May 2026 12:42:32 +1000 [thread overview]
Message-ID: <review-patch5-20260512215156.4083082-6-cascardo@igalia.com> (raw)
In-Reply-To: <20260512215156.4083082-6-cascardo@igalia.com>
Patch Review
**Issue: `amdgpu_dmem_ctx.fd` field is declared but never assigned.**
```c
struct amdgpu_dmem_ctx {
int fd; /* <-- never assigned */
amdgpu_device_handle device;
amdgpu_bo_handle *handles;
};
```
In `amdgpu_dmem_init`, the struct is `malloc`'d (not zeroed) and `actx->fd` is never set. It isn't read anywhere either, so it's dead code. Either remove the field or assign it.
**Design concern: fill_vram assertion relaxation.** The change:
```c
igt_assert_f(err == -ENOMEM || err == -ENOSPC || err == 0,
"Expected -ENOMEM,-ENOSPC or success, got %d (%s)\n",
err, strerror(-err));
```
Accepting `err == 0` means `fill_vram` can return having allocated *all* `max_bo` BOs without ever hitting the cgroup limit. For amdgpu, the VRAM domain is a preference, not a constraint -- the allocator falls back to GTT. This means `test_write_eviction` on amdgpu may not actually test eviction at all, since no cgroup error is triggered. The commit message acknowledges this ("That can still be tracked with dmem.current"), but the test's core logic (fill until cgroup rejects, then lower max and watch usage drop) depends on the fill actually hitting the limit.
Consider using `AMDGPU_GEM_CREATE_NO_CPU_ACCESS` or another flag to force VRAM-only placement so the test actually exercises the cgroup path. Otherwise the amdgpu variant of `write_eviction` is essentially untested.
**Nit:** `#include "lib/amdgpu/amd_memory.h"` -- the `lib/` prefix in the include path is unusual for IGT; most files use paths relative to the lib directory (e.g., `#include "amdgpu/amd_memory.h"`). This works because of how meson sets include directories, but it's inconsistent with the rest of the codebase.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-16 2:42 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 21:51 [PATCH i-g-t 0/8] dmem: add amdgpu support and one more test Thadeu Lima de Souza Cascardo
2026-05-12 21:51 ` [PATCH i-g-t 1/8] Introduce dmem driver and implement Xe support Thadeu Lima de Souza Cascardo
2026-05-16 2:42 ` Claude review: " Claude Code Review Bot
2026-05-12 21:51 ` [PATCH i-g-t 2/8] Adjust xe_cgroups test to use igt_dmem_driver Thadeu Lima de Souza Cascardo
2026-05-13 15:18 ` Kamil Konieczny
2026-05-16 2:42 ` Claude review: " Claude Code Review Bot
2026-05-12 21:51 ` [PATCH i-g-t 3/8] Make xe_cgroup test a generic test Thadeu Lima de Souza Cascardo
2026-05-13 15:21 ` Kamil Konieczny
2026-05-16 2:42 ` Claude review: " Claude Code Review Bot
2026-05-12 21:51 ` [PATCH i-g-t 4/8] amdgpu: add amdgpu_cgroup_region_name Thadeu Lima de Souza Cascardo
2026-05-16 2:42 ` Claude review: " Claude Code Review Bot
2026-05-12 21:51 ` [PATCH i-g-t 5/8] igt_dmem_driver: add amdgpu support Thadeu Lima de Souza Cascardo
2026-05-13 15:26 ` Kamil Konieczny
2026-05-16 2:42 ` Claude Code Review Bot [this message]
2026-05-12 21:51 ` [PATCH i-g-t 6/8] dmem: add test for current/max Thadeu Lima de Souza Cascardo
2026-05-13 15:31 ` Kamil Konieczny
2026-05-16 2:42 ` Claude review: " Claude Code Review Bot
2026-05-12 21:51 ` [PATCH i-g-t 7/8] dmem: only check for dmem availability once Thadeu Lima de Souza Cascardo
2026-05-16 2:42 ` Claude review: " Claude Code Review Bot
2026-05-12 21:51 ` [PATCH i-g-t 8/8] dmem: get region once per driver Thadeu Lima de Souza Cascardo
2026-05-16 2:42 ` Claude review: " Claude Code Review Bot
2026-05-12 22:27 ` [PATCH i-g-t 0/8] dmem: add amdgpu support and one more test Thadeu Lima de Souza Cascardo
2026-05-13 8:06 ` Christian König
2026-05-13 8:54 ` Thomas Hellström
2026-05-16 2:42 ` 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-patch5-20260512215156.4083082-6-cascardo@igalia.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