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: Add reclaim to the dmem cgroup controller
Date: Sat, 16 May 2026 14:48:42 +1000	[thread overview]
Message-ID: <review-overall-20260511173008.36526-1-thomas.hellstrom@linux.intel.com> (raw)
In-Reply-To: <20260511173008.36526-1-thomas.hellstrom@linux.intel.com>

Overall Series Review

Subject: Add reclaim to the dmem cgroup controller
Author: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>
Patches: 6
Reviewed: 2026-05-16T14:48:42.283985

---

This is a well-structured v3 series from Thomas Hellström that adds synchronous reclaim to the dmem cgroup controller, enabling `dmem.max` to be lowered below current VRAM usage without silently failing. The approach is sound: set the new limit immediately (to block concurrent allocations), then invoke a driver-provided reclaim callback to evict memory. The series decomposes cleanly into a bugfix (patch 1), the core cgroup infrastructure (patch 2), the TTM integration layer (patch 3), and two driver wiring patches (4-5).

The synchronization design using `unregister_sem` (rwsem) to protect reclaim callbacks against concurrent unregistration is well thought out and addresses the v2 feedback from Sashiko-bot. The bounded retry loop with signal handling mirrors `memory.max` semantics from the memory cgroup controller, which is a sensible design choice.

Key concerns:
- The `sleeping_lock` locking mode in patch 3 deliberately forgoes WW deadlock detection. The commit message acknowledges this ("should sooner than later be converted to full WW transactions"). This is acceptable for the admin-initiated cgroup write path, but should be tracked as future work.
- The change from `page_counter_set_max()` to raw `xchg()` in patch 2 is a deliberate semantic change that should perhaps be called out more explicitly in the commit message.

Overall: **Looks good with minor comments below.**

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-05-16  4:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11 17:30 [PATCH v3 0/5] Add reclaim to the dmem cgroup controller Thomas Hellström
2026-05-11 17:30 ` [PATCH v3 1/5] drm/amdgpu: Fix init ordering in amdgpu_vram_mgr_init() Thomas Hellström
2026-05-16  4:48   ` Claude review: " Claude Code Review Bot
2026-05-11 17:30 ` [PATCH v3 2/5] cgroup/dmem: Add reclaim callback for lowering max below current usage Thomas Hellström
2026-05-16  4:48   ` Claude review: " Claude Code Review Bot
2026-05-11 17:30 ` [PATCH v3 3/5] drm/ttm: Hook up a cgroup-aware reclaim callback for the dmem controller Thomas Hellström
2026-05-16  4:48   ` Claude review: " Claude Code Review Bot
2026-05-11 17:30 ` [PATCH v3 4/5] drm/xe: Wire up dmem cgroup reclaim for VRAM manager Thomas Hellström
2026-05-16  4:48   ` Claude review: " Claude Code Review Bot
2026-05-11 17:30 ` [PATCH v3 5/5] drm/amdgpu: " Thomas Hellström
2026-05-16  4:48   ` Claude review: " Claude Code Review Bot
2026-05-16  4:48 ` Claude Code Review Bot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-05-12  8:24 [PATCH v4 0/5] Add reclaim to the dmem cgroup controller Thomas Hellström
2026-05-16  4:03 ` 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-overall-20260511173008.36526-1-thomas.hellstrom@linux.intel.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