From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: ttm/pool: Use sentinels in debugfs Date: Tue, 28 Apr 2026 14:24:09 +1000 Message-ID: In-Reply-To: <20260427162253.682415-1-mario.limonciello@amd.com> References: <20260427162253.682415-1-mario.limonciello@amd.com> <20260427162253.682415-1-mario.limonciello@amd.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Correctness: Good.** The sentinel checks match exactly what the underlyin= g functions can return: - `ttm_pool_shrinker_count()` at line 1222 returns `SHRINK_EMPTY` when `num= _pages` is 0 =E2=80=94 the patch correctly checks `count =3D=3D SHRINK_EMPT= Y`. - `ttm_pool_shrinker_scan()` at line 1213 returns `SHRINK_STOP` when `num_f= reed` is 0 =E2=80=94 the patch correctly checks `scanned =3D=3D SHRINK_STOP= `. **Minor observations:** 1. **Scan is unconditional even when count shows empty.** The code calls `t= tm_pool_shrinker_scan()` even when `count =3D=3D SHRINK_EMPTY` (i.e., there= are zero pages on this node). The scan will iterate and find nothing to fr= ee, 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 !=3D SHRINK_EMPTY)` guard could = avoid the pointless scan call. 2. **The comment is reasonable.** The inline comment `/* Convert shrinker A= PI sentinel values to 0 for debugfs output */` explains the *why* clearly e= nough. 3. **The variable split is good practice.** Separating `scanned =3D ttm_poo= l_shrinker_scan(...)` out of the `seq_printf` call improves readability and= enables the sentinel checks without evaluating side effects in a printf ar= gument list. **No correctness issues found.** The patch is a clean, minimal fix for a re= al debugfs output bug. Reviewed-by: looks appropriate. --- Generated by Claude Code Patch Reviewer