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/panthor: Part ways with drm_gem_shmem_object
Date: Tue, 10 Mar 2026 12:15:41 +1000	[thread overview]
Message-ID: <review-patch5-20260309151119.290217-6-boris.brezillon@collabora.com> (raw)
In-Reply-To: <20260309151119.290217-6-boris.brezillon@collabora.com>

Patch Review

This is the largest and most impactful patch. It replaces the `drm_gem_shmem_object` base with a plain `drm_gem_object` and implements custom page management, vmap, sgt, pin/unpin, and mmap handling.

Key observations:

1. **`panthor_gem_backing_pin_locked` / `panthor_gem_backing_unpin_locked`**: The pin/unpin pair is clean, with the unpin explicitly leaving pages allocated (lazy cleanup). This is appropriate for the upcoming shrinker.

2. **`panthor_gem_vmap_get_locked` error path**: The error path calls `panthor_gem_backing_unpin_locked(bo)` which is correct — it undoes the pin acquired earlier in the function.

3. **`panthor_gem_free_object`**: For non-imported objects, the cleanup properly takes the resv lock before cleaning up vmap, sgt, and pages. For imported objects, `drm_prime_gem_destroy()` is called. Note that the `MODULE_IMPORT_NS("DMA_BUF")` addition is needed because `drm_prime_gem_destroy` is in that namespace.

4. **Missing `drm_gem_free_mmap_offset`**: The old code called `drm_gem_free_mmap_offset()` but the new code doesn't seem to. However, `drm_gem_object_release()` should handle this via the VMA offset manager cleanup, so this should be fine.

5. **`panthor_gem_create` GFP flags**: The comment about MOVABLE zone and CMA is carried over from shmem. The `GFP_HIGHUSER | __GFP_RETRY_MAYFAIL | __GFP_NOWARN` mask is appropriate.

6. **`panthor_gem_alloc_object` missing `flags` parameter type**: The function takes `uint32_t flags` but the kernel convention is `u32`. Minor style nit.

7. **`to_panthor_bo` change to `container_of_const`**: Good — this properly handles const propagation.

8. The `panthor_gem_fault` handler holds `dma_resv_lock()` unconditionally (non-interruptible) in the fault path. This is a concern — if the lock is contended, userspace can't be interrupted. This is addressed in patch 6 (lazy allocation) where it's reworked.

No blocking issues. The lack of R-b on this patch is notable given its size.

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-03-10  2:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-09 15:11 [PATCH v5 0/9] drm/panthor: Add a GEM shrinker Boris Brezillon
2026-03-09 15:11 ` [PATCH v5 1/9] drm/gem: Consider GEM object reclaimable if shrinking fails Boris Brezillon
2026-03-10  2:15   ` Claude review: " Claude Code Review Bot
2026-03-09 15:11 ` [PATCH v5 2/9] drm/panthor: Move panthor_gems_debugfs_init() to panthor_gem.c Boris Brezillon
2026-03-10  2:15   ` Claude review: " Claude Code Review Bot
2026-03-09 15:11 ` [PATCH v5 3/9] drm/panthor: Group panthor_kernel_bo_xxx() helpers Boris Brezillon
2026-03-10  2:15   ` Claude review: " Claude Code Review Bot
2026-03-09 15:11 ` [PATCH v5 4/9] drm/panthor: Don't call drm_gpuvm_bo_extobj_add() if the object is private Boris Brezillon
2026-03-10  2:15   ` Claude review: " Claude Code Review Bot
2026-03-09 15:11 ` [PATCH v5 5/9] drm/panthor: Part ways with drm_gem_shmem_object Boris Brezillon
2026-03-09 15:34   ` Steven Price
2026-03-10  2:15   ` Claude Code Review Bot [this message]
2026-03-09 15:11 ` [PATCH v5 6/9] drm/panthor: Lazily allocate pages on mmap() Boris Brezillon
2026-03-10  2:15   ` Claude review: " Claude Code Review Bot
2026-03-09 15:11 ` [PATCH v5 7/9] drm/panthor: Split panthor_vm_prepare_map_op_ctx() to prepare for reclaim Boris Brezillon
2026-03-10  2:15   ` Claude review: " Claude Code Review Bot
2026-03-09 15:11 ` [PATCH v5 8/9] drm/panthor: Track the number of mmap on a BO Boris Brezillon
2026-03-10  2:15   ` Claude review: " Claude Code Review Bot
2026-03-09 15:11 ` [PATCH v5 9/9] drm/panthor: Add a GEM shrinker Boris Brezillon
2026-03-10  2:15   ` Claude review: " Claude Code Review Bot
2026-03-10  2:15 ` 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-20260309151119.290217-6-boris.brezillon@collabora.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