From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/panthor: Add freed_sz parameter to reclaim_priv_bos
Date: Thu, 07 May 2026 13:42:51 +1000 [thread overview]
Message-ID: <review-patch1-20260506-panthor-explicit-reclaim-v1-1-44f82ac147ce@collabora.com> (raw)
In-Reply-To: <20260506-panthor-explicit-reclaim-v1-1-44f82ac147ce@collabora.com>
Patch Review
**Verdict: Looks reasonable, minor concern.**
The change adds an optional `size_t *freed_sz` out-parameter to `panthor_mmu_reclaim_priv_bos()`, which accumulates `panthor_vm_page_size(vm) * newly_freed` across VMs.
The existing caller in `panthor_gem_shrinker_scan` passes `NULL`, preserving existing behavior. The implementation is clean:
```c
newly_freed = drm_gem_lru_scan(&vm->reclaim.lru, nr_to_scan - freed,
remaining, shrink, NULL);
if (freed_sz)
*freed_sz += panthor_vm_page_size(vm) * newly_freed;
freed += newly_freed;
```
**Minor note:** `drm_gem_lru_scan` returns the number of *objects* freed, not pages. The calculation `panthor_vm_page_size(vm) * newly_freed` assumes each object is exactly one page. If multi-page BOs are ever on the reclaim LRU, this underreports the actual freed size. The commit message says "the page size is a per-VM property" which implies these are single-page objects, but a comment or assertion documenting this assumption would help.
The `freed_sz` is currently only consumed by `drm_dbg` in patch 3, so the practical impact of any inaccuracy is low.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-07 3:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-06 10:45 [PATCH 0/4] Let userspace explicitly trigger memory reclaims Nicolas Frattaroli
2026-05-06 10:45 ` [PATCH 1/4] drm/panthor: Add freed_sz parameter to reclaim_priv_bos Nicolas Frattaroli
2026-05-06 15:06 ` Steven Price
2026-05-06 15:19 ` Nicolas Frattaroli
2026-05-07 3:42 ` Claude Code Review Bot [this message]
2026-05-06 10:45 ` [PATCH 2/4] MAINTAINERS: Add sysfs ABI docs to list of panthor files Nicolas Frattaroli
2026-05-07 3:42 ` Claude review: " Claude Code Review Bot
2026-05-06 10:45 ` [PATCH 3/4] drm/panthor: Add explicit memory reclaim sysfs knob Nicolas Frattaroli
2026-05-07 3:42 ` Claude review: " Claude Code Review Bot
2026-05-06 10:45 ` [PATCH 4/4] drm/panthor: Add explicit memory claim " Nicolas Frattaroli
2026-05-07 3:42 ` Claude review: " Claude Code Review Bot
2026-05-06 15:06 ` [PATCH 0/4] Let userspace explicitly trigger memory reclaims Steven Price
2026-05-06 15:43 ` Nicolas Frattaroli
2026-05-06 15:55 ` Steven Price
2026-05-07 3: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-patch1-20260506-panthor-explicit-reclaim-v1-1-44f82ac147ce@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