From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260430182335.2132382-1-matthew.brost@intel.com> References: <20260430182335.2132382-1-matthew.brost@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: mm, drm/ttm, drm/xe: Avoid reclaim/eviction loops under fragmentat= ion Author: Matthew Brost Patches: 7 Reviewed: 2026-05-05T10:13:40.738286 --- This is a well-motivated 6-patch series addressing a real and measurable pe= rformance regression on Xe GPU systems under memory fragmentation. The prob= lem statement is clear: kswapd-driven shrinker calls evict GPU BOs even whe= n the system has ample free memory but is fragmented at high orders, leadin= g to a pathological evict-rebind loop. The approach is layered sensibly: (1) plumb allocation order through to shr= inkers, (2) add a fragmentation heuristic, (3) adjust TTM pool allocation G= FP 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 reasonabl= e approach, but this is core mm infrastructure =E2=80=94 it needs mm mainta= iner buy-in (Andrew Morton, etc.). The type choice of `s8` for `order` matc= hes `scan_control.order` which is good for consistency. 2. **Patch 3 (TTM GFP change):** The semantic change from `~__GFP_DIRECT_RE= CLAIM` to `~__GFP_RECLAIM` is significant =E2=80=94 it also suppresses kswa= pd wakeup. The condition change from `order > beneficial_order` to `order != =3D beneficial_order` means orders *below* beneficial_order also lose recla= im, 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 i= t's part of the mm public API, which needs mm maintainer agreement. --- --- Generated by Claude Code Patch Reviewer