From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/ttm: Be more aggressive when allocating below protection limit Date: Sat, 14 Mar 2026 07:10:16 +1000 Message-ID: In-Reply-To: <20260313-dmemcg-aggressive-protect-v6-5-7c71cc1492db@gmx.de> References: <20260313-dmemcg-aggressive-protect-v6-0-7c71cc1492db@gmx.de> <20260313-dmemcg-aggressive-protect-v6-5-7c71cc1492db@gmx.de> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review This is the core behavioral change. When an allocation is protected by min/= low and resource allocation fails, TTM now attempts eviction of unprotected= buffers. **Logic flow**: ```c if (!alloc_state->in_evict) { may_evict |=3D dmem_cgroup_below_min(NULL, alloc_state->charge_pool); alloc_state->may_try_low =3D may_evict; may_evict |=3D dmem_cgroup_below_low(NULL, alloc_state->charge_pool); } ``` This is subtly clever: - If below **min**: `may_evict=3Dtrue`, `may_try_low=3Dtrue` (can try evict= ing low-protected BOs too) - If below **low** (but not min): `may_evict=3Dtrue`, `may_try_low=3Dfalse`= (only evict unprotected BOs) - If neither: no change to `may_evict`, no aggressive eviction The `may_try_low` flag gates the "retry with low" logic in `ttm_bo_evict_al= loc()`, preventing low-but-not-min protected allocations from evicting low-= protected buffers. This correctly models the min > low priority. **Comment style**: The block comment at line 2133 starts with `/* If we fai= led...` =E2=80=94 kernel style prefers the opening `/*` on its own line for= multi-line comments. Minor style nit. **The `may_try_low` field naming** could be slightly confusing since settin= g it to `true` means "yes, we may try evicting low-protected BOs" but the s= emantics in `ttm_bo_evict_alloc` are "skip the low retry if may_try_low is = false". This is consistent but requires careful reading. --- Generated by Claude Code Patch Reviewer