From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/buddy: Integrate lockdep annotations for gpu buddy manager
Date: Tue, 05 May 2026 11:39:29 +1000 [thread overview]
Message-ID: <review-overall-20260429123714.3913374-2-tejas.upadhyay@intel.com> (raw)
In-Reply-To: <20260429123714.3913374-2-tejas.upadhyay@intel.com>
Overall Series Review
Subject: drm/buddy: Integrate lockdep annotations for gpu buddy manager
Author: Tejas Upadhyay <tejas.upadhyay@intel.com>
Patches: 4
Reviewed: 2026-05-05T11:39:29.714051
---
This is a single patch adding lockdep annotations to the `gpu_buddy` allocator, closely modeled after the existing `drm_gpusvm_driver_set_lock()` / `drm_gpusvm_driver_lock_held()` pattern. The approach is sound: store a pointer to the driver's `lockdep_map`, then assert it's held on entry to exported APIs. The implementation is mostly correct, but has several gaps and issues:
1. **Incomplete driver coverage**: Only xe is wired up, but amdgpu, i915, and the ttm test mock manager also call gpu_buddy APIs and need `gpu_buddy_driver_set_lock()` calls. Without those, the annotation is inert for 3 of 4 consumers.
2. **Incomplete API coverage**: Two exported functions (`gpu_buddy_fini` and `gpu_buddy_block_print`) plus one drm-layer export (`drm_buddy_block_print`) are missing annotations.
3. **Minor style inconsistency**: The `#else` stubs for the no-LOCKDEP case differ between the macro (uses `do { (void)(mm); (void)(lock); } while (0)`) and the original pattern (uses `do {} while (0)`). Not a bug, but inconsistent with the `drm_gpusvm` template this was copied from.
4. **The macro lacks the local-variable guard present in the drm_gpusvm template**: The `drm_gpusvm_driver_set_lock` macro accesses `(gpusvm)` directly, but the gpu_buddy version uses a local `__mm`. This is actually an *improvement* over the gpusvm original — good.
Overall this is a reasonable v1 that needs a respin to cover the remaining callers and APIs.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-05 1:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-29 12:37 [PATCH] drm/buddy: Integrate lockdep annotations for gpu buddy manager Tejas Upadhyay
2026-04-30 9:14 ` Matthew Auld
2026-04-30 9:34 ` Upadhyay, Tejas
2026-04-30 13:12 ` Upadhyay, Tejas
2026-05-05 1:39 ` Claude Code Review Bot [this message]
2026-05-05 1:39 ` 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-overall-20260429123714.3913374-2-tejas.upadhyay@intel.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