From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: gpu/buddy: Per-order free and used block scoreboards Date: Mon, 25 May 2026 19:06:37 +1000 Message-ID: In-Reply-To: <20260522092600.32818-1-francois.dugast@intel.com> References: <20260522092600.32818-1-francois.dugast@intel.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Overall Series Review Subject: gpu/buddy: Per-order free and used block scoreboards Author: Francois Dugast Patches: 9 Reviewed: 2026-05-25T19:06:37.067104 --- This is a well-structured 5-patch series that adds O(1) per-order free and = used block counting to the gpu_buddy allocator. The series has good logical= decomposition: bug fix first (patch 1), dead-code cleanup (patch 2), refac= toring (patch 3), then the two feature patches (patches 4 and 5). Patches 1= , 3, and 5 already carry `Reviewed-by: Matthew Auld`. **Patch 1 is a genuine bug fix** =E2=80=94 the existing error paths call `_= _gpu_buddy_free()` on a block that is still linked in an rbtree, which can = corrupt the tree or cause use-after-free during coalescing. This is the mos= t important patch in the series and should be considered for stable. **The scoreboard approach is sound.** The incremental maintenance at the fo= ur state-transition points (mark_free, mark_allocated, mark_split, and the = direct rbtree_remove sites) correctly mirrors the existing tree operations.= The print functions become trivial O(1) lookups, which is a real win on la= rge VRAM heaps. **One concern worth raising:** the `free` vs `block_size` threshold change = in patch 5 (from `free < SZ_1M` to `block_size < SZ_1M`) changes the KiB/Mi= B display logic =E2=80=94 this is intentional and correct (avoids showing "= 0 MiB" for orders with zero blocks), but it changes debugfs output format w= hich could break any userspace parsing. Overall the series looks good. A few observations per patch below. --- Generated by Claude Code Patch Reviewer