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: drm/ttm: Issue direct reclaim at beneficial_order
Date: Tue, 05 May 2026 10:13:41 +1000	[thread overview]
Message-ID: <review-patch3-20260430182335.2132382-4-matthew.brost@intel.com> (raw)
In-Reply-To: <20260430182335.2132382-4-matthew.brost@intel.com>

Patch Review

**Overall:** This is the most impactful patch in terms of allocation behavior change.

**Key change:**
```c
-	if (beneficial_order && order > beneficial_order)
-		gfp_flags &= ~__GFP_DIRECT_RECLAIM;
+	if (order && beneficial_order && order != beneficial_order)
+		gfp_flags &= ~__GFP_RECLAIM;
```

**Concerns:**

- **`~__GFP_RECLAIM` vs `~__GFP_DIRECT_RECLAIM`:** The old code only suppressed direct reclaim (keeping kswapd wakeup possible). The new code clears `__GFP_RECLAIM` entirely (`__GFP_DIRECT_RECLAIM | __GFP_KSWAPD_RECLAIM`), meaning these allocations won't even wake kswapd. This is a substantial semantic change. The commit message says "issuing direct reclaim or triggering kswap at a lower order than beneficial_order is ineffective" — this is true for the driver, but kswapd serves the entire system, not just this driver. Suppressing kswapd wakeup from TTM allocations could delay legitimate system-wide reclaim. This deserves more justification or at least acknowledgment in the commit message.

- **Orders below beneficial_order:** The old condition was `order > beneficial_order` — only orders *above* the sweet spot lost direct reclaim. The new condition `order != beneficial_order` also covers orders *below* beneficial_order. Combined with the broader `~__GFP_RECLAIM`, this means a TTM order-4 allocation on a system with beneficial_order=9 will now be `__GFP_NORETRY | __GFP_NOWARN | __GFP_THISNODE` with NO reclaim at all. If this allocation fails, TTM falls back to smaller orders, and the order-0 fallback (`if (order)` is false for order 0) will still get full reclaim. But intermediate orders between 1 and beneficial_order-1 also lose all reclaim. Is that intended? The commit message only discusses orders above and at beneficial_order, not below.

- **Interaction with existing `__GFP_NORETRY`:** Note that for `order > 0`, the function already sets `__GFP_NORETRY` at line 161. Combined with clearing `__GFP_RECLAIM`, these allocations become pure "try once, fail fast" — which is probably fine since TTM has its own fallback path, but it's worth calling out.

- **Reviewed-by from Christian Koenig** is reassuring since he understands TTM pool behavior deeply.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-05  0:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-30 18:23 [PATCH v3 0/6] mm, drm/ttm, drm/xe: Avoid reclaim/eviction loops under fragmentation Matthew Brost
2026-04-30 18:23 ` [PATCH v3 1/6] mm: Wire up order in shrink_control Matthew Brost
2026-05-05  0:13   ` Claude review: " Claude Code Review Bot
2026-04-30 18:23 ` [PATCH v3 2/6] mm: Introduce zone_maybe_fragmented_in_shrinker() Matthew Brost
2026-05-05  0:13   ` Claude review: " Claude Code Review Bot
2026-04-30 18:23 ` [PATCH v3 3/6] drm/ttm: Issue direct reclaim at beneficial_order Matthew Brost
2026-05-05  0:13   ` Claude Code Review Bot [this message]
2026-04-30 18:23 ` [PATCH v3 4/6] drm/ttm: Introduce ttm_bo_shrink_kswap_maybe_fragmented() Matthew Brost
2026-05-05  0:13   ` Claude review: " Claude Code Review Bot
2026-04-30 18:23 ` [PATCH v3 5/6] drm/xe: Set TTM device beneficial_order to 9 (2M) Matthew Brost
2026-05-05  0:13   ` Claude review: " Claude Code Review Bot
2026-04-30 18:23 ` [PATCH v3 6/6] drm/xe: Avoid shrinker reclaim from kswapd under fragmentation Matthew Brost
2026-05-05  0:13   ` Claude review: " Claude Code Review Bot
2026-05-05  0:13 ` Claude review: mm, drm/ttm, drm/xe: Avoid reclaim/eviction loops " Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-04-30 19:18 [PATCH v4 0/6] " Matthew Brost
2026-04-30 19:18 ` [PATCH v4 3/6] drm/ttm: Issue direct reclaim at beneficial_order Matthew Brost
2026-05-05  0:00   ` Claude review: " Claude Code Review Bot
2026-04-21  1:26 [PATCH 0/3] drm/ttm, drm/xe: Avoid reclaim/eviction loops under fragmentation Matthew Brost
2026-04-21  1:26 ` [PATCH 1/3] drm/ttm: Issue direct reclaim at beneficial_order Matthew Brost
2026-04-22 23:01   ` 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-patch3-20260430182335.2132382-4-matthew.brost@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