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: Rust bindings for gem shmem
Date: Sun, 12 Apr 2026 12:01:17 +1000	[thread overview]
Message-ID: <review-overall-20260409001559.622026-1-lyude@redhat.com> (raw)
In-Reply-To: <20260409001559.622026-1-lyude@redhat.com>

Overall Series Review

Subject: Rust bindings for gem shmem
Author: Lyude Paul <lyude@redhat.com>
Patches: 12
Reviewed: 2026-04-12T12:01:17.613682

---

This is v10 of the Rust bindings for DRM GEM shmem objects, from Lyude Paul. The series adds two C-side helper exports (`__drm_gem_shmem_free_sgt_locked` and `drm_gem_shmem_get_pages_sgt_locked`), then builds Rust abstractions for SGTable and VMap on top of them. The overall design — using `Devres` to revoke SGTable mappings on driver unbind and lifetime-bounded `VMapRef` vs. owned `VMap` — is sound and well-motivated.

However, there is one significant concern around **object destruction ordering**: when a GEM object with a mapped SGTable is freed while the driver is still bound (the normal case for userspace-driven buffer teardown), `drm_gem_shmem_release` frees the sgt and destroys the `dma_resv`, and then the Rust `Object<T>` field drops run, potentially triggering `SGTableMap::drop` which tries to re-lock the destroyed `dma_resv` and operate on the already-NULL `sgt`. This needs clarification or a fix.

The C patches (2/5, 3/5) are straightforward. The Rust patches (4/5, 5/5) are ambitious and mostly well-structured, with good kunit test coverage in patch 5. A few doc/comment typos and a couple of safety-comment inaccuracies should be cleaned up.

---
Generated by Claude Code Patch Reviewer

      parent reply	other threads:[~2026-04-12  2:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09  0:12 [PATCH v10 0/5] Rust bindings for gem shmem Lyude Paul
2026-04-09  0:12 ` [PATCH v10 1/5] rust: drm: gem: s/device::Device/Device/ for shmem.rs Lyude Paul
2026-04-10  7:54   ` Alexandre Courbot
2026-04-12  2:01   ` Claude review: " Claude Code Review Bot
2026-04-09  0:12 ` [PATCH v10 2/5] drm/gem/shmem: Introduce __drm_gem_shmem_free_sgt_locked() Lyude Paul
2026-04-10  7:54   ` Alexandre Courbot
2026-04-12  2:01   ` Claude review: " Claude Code Review Bot
2026-04-09  0:12 ` [PATCH v10 3/5] drm/gem/shmem: Export drm_gem_shmem_get_pages_sgt_locked() Lyude Paul
2026-04-10  7:55   ` Alexandre Courbot
2026-04-12  2:01   ` Claude review: " Claude Code Review Bot
2026-04-09  0:12 ` [PATCH v10 4/5] rust: drm: gem: Introduce shmem::SGTable Lyude Paul
2026-04-09 22:57   ` Deborah Brouwer
2026-04-10  7:55   ` Alexandre Courbot
2026-04-12  2:01   ` Claude review: " Claude Code Review Bot
2026-04-09  0:12 ` [PATCH v10 5/5] rust: drm: gem: Add vmap functions to shmem bindings Lyude Paul
2026-04-11 13:32   ` Alexandre Courbot
2026-04-12  2:01   ` Claude review: " Claude Code Review Bot
2026-04-12  2:01 ` Claude Code Review Bot [this message]

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-20260409001559.622026-1-lyude@redhat.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