Re: [PATCH v4 0/6] mm, drm/ttm, drm/xe: Avoid reclaim/eviction loops under fragmentation
From: Andrew Morton
Date: Thu Apr 30 2026 - 19:01:17 EST
On Thu, 30 Apr 2026 12:18:03 -0700 Matthew Brost <matthew.brost@xxxxxxxxx> wrote:
> TTM allocations at higher orders can drive Xe into a pathological
> reclaim loop when memory is fragmented:
>
> kswapd → shrinker → eviction → rebind (exec ioctl) → repeat
>
> In this state, reclaim is triggered despite substantial free memory,
> but fails to produce contiguous higher-order pages. The Xe shrinker then
> evicts active buffer objects, increasing faulting and rebind activity
> and further feeding the loop. The result is high CPU overhead and poor
> GPU forward progress.
>
> ...
>
> This series addresses the issue in two ways:
>
> TTM: Restrict direct reclaim to beneficial_order. Larger allocations
> use __GFP_NORETRY to fail quickly rather than triggering reclaim.
>
> Xe: Introduce a heuristic in the shrinker to avoid eviction when
> running under kswapd and the system appears memory-rich but
> fragmented.
Please cc everyone on all the patches? It's kind of annoying to have
to hunt around to find out how these proposed changes will be used.
Personal preference, anyway.
AI review flagged a few possible issues:
https://sashiko.dev/#/patchset/20260430191809.2142544-1-matthew.brost@xxxxxxxxx