From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: ttm/pool: Use sentinels in debugfs
Date: Tue, 28 Apr 2026 14:24:09 +1000 [thread overview]
Message-ID: <review-patch1-20260427162253.682415-1-mario.limonciello@amd.com> (raw)
In-Reply-To: <20260427162253.682415-1-mario.limonciello@amd.com>
Patch Review
**Correctness: Good.** The sentinel checks match exactly what the underlying functions can return:
- `ttm_pool_shrinker_count()` at line 1222 returns `SHRINK_EMPTY` when `num_pages` is 0 — the patch correctly checks `count == SHRINK_EMPTY`.
- `ttm_pool_shrinker_scan()` at line 1213 returns `SHRINK_STOP` when `num_freed` is 0 — the patch correctly checks `scanned == SHRINK_STOP`.
**Minor observations:**
1. **Scan is unconditional even when count shows empty.** The code calls `ttm_pool_shrinker_scan()` even when `count == SHRINK_EMPTY` (i.e., there are zero pages on this node). The scan will iterate and find nothing to free, returning `SHRINK_STOP`. This is harmless since this is a debugfs path (not performance-critical), and the pre-existing code had the same behavior. Not a blocking concern, but a `if (count != SHRINK_EMPTY)` guard could avoid the pointless scan call.
2. **The comment is reasonable.** The inline comment `/* Convert shrinker API sentinel values to 0 for debugfs output */` explains the *why* clearly enough.
3. **The variable split is good practice.** Separating `scanned = ttm_pool_shrinker_scan(...)` out of the `seq_printf` call improves readability and enables the sentinel checks without evaluating side effects in a printf argument list.
**No correctness issues found.** The patch is a clean, minimal fix for a real debugfs output bug.
Reviewed-by: looks appropriate.
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-04-28 4:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 16:22 [PATCH] ttm/pool: Use sentinels in debugfs Mario Limonciello
2026-04-28 4:24 ` Claude review: " Claude Code Review Bot
2026-04-28 4:24 ` 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-patch1-20260427162253.682415-1-mario.limonciello@amd.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