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: mm, drm/ttm, drm/xe: Avoid reclaim/eviction loops under fragmentation
Date: Tue, 05 May 2026 10:13:40 +1000	[thread overview]
Message-ID: <review-overall-20260430182335.2132382-1-matthew.brost@intel.com> (raw)
In-Reply-To: <20260430182335.2132382-1-matthew.brost@intel.com>

Overall Series Review

Subject: mm, drm/ttm, drm/xe: Avoid reclaim/eviction loops under fragmentation
Author: Matthew Brost <matthew.brost@intel.com>
Patches: 7
Reviewed: 2026-05-05T10:13:40.738286

---

This is a well-motivated 6-patch series addressing a real and measurable performance regression on Xe GPU systems under memory fragmentation. The problem statement is clear: kswapd-driven shrinker calls evict GPU BOs even when the system has ample free memory but is fragmented at high orders, leading to a pathological evict-rebind loop.

The approach is layered sensibly: (1) plumb allocation order through to shrinkers, (2) add a fragmentation heuristic, (3) adjust TTM pool allocation GFP flags, (4) add a TTM helper to detect fragmentation under kswapd, (5-6) wire it into Xe. The series has appropriate Reviewed-by tags from Christian Koenig (TTM maintainer) and Andi Shyti on the TTM/Xe patches.

**Key concerns:**

1. **Patch 1 (mm core):** Adding `order` to `shrink_control` is a reasonable approach, but this is core mm infrastructure — it needs mm maintainer buy-in (Andrew Morton, etc.). The type choice of `s8` for `order` matches `scan_control.order` which is good for consistency.

2. **Patch 3 (TTM GFP change):** The semantic change from `~__GFP_DIRECT_RECLAIM` to `~__GFP_RECLAIM` is significant — it also suppresses kswapd wakeup. The condition change from `order > beneficial_order` to `order != beneficial_order` means orders *below* beneficial_order also lose reclaim, which needs careful thought.

3. **Patch 2 (fragmentation heuristic):** The `2x high watermark` heuristic is intentionally coarse. It could produce false positives on systems with legitimately high watermarks. Placing it in `vmstat.h` as an inline means it's part of the mm public API, which needs mm maintainer agreement.

---

---
Generated by Claude Code Patch Reviewer

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

Thread overview: 15+ 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 review: " Claude Code Review Bot
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 Code Review Bot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-04-30 19:18 [PATCH v4 0/6] mm, drm/ttm, drm/xe: Avoid reclaim/eviction loops " Matthew Brost
2026-05-05  0:00 ` 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-20260430182335.2132382-1-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