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: Fri, 27 Feb 2026 13:36:28 +1000 Message-ID: In-Reply-To: <20260225-dmemcg-aggressive-protect-v4-5-de847ab35184@gmx.de> References: <20260225-dmemcg-aggressive-protect-v4-0-de847ab35184@gmx.de> <20260225-dmemcg-aggressive-protect-v4-5-de847ab35184@gmx.de> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review This is the core behavioral change. The extensive comment block explaining the design rationale is well-written and thorough. The protection logic is correct: ```c + may_evict |= dmem_cgroup_below_min(NULL, alloc_state->charge_pool); + below_low = dmem_cgroup_below_low(NULL, alloc_state->charge_pool); + alloc_state->only_evict_unprotected = !may_evict && below_low; ``` This correctly implements the priority hierarchy: - **below_min**: aggressive eviction (even low-protected buffers) via `may_evict = true` - **below_low only**: restricted eviction (only unprotected buffers) via `only_evict_unprotected = true` - **force_space already set**: normal full eviction path (`only_evict_unprotected` stays false because `!may_evict` is false) The `only_evict_unprotected` flag correctly prevents the retry-with-low logic in `ttm_bo_evict_alloc`: ```c + if (!lret && evict_walk.hit_low && !state->only_evict_unprotected) { ``` **Nit**: The multi-line comment style doesn't quite follow kernel convention: ```c + /* If we failed to find enough BOs to evict, but we skipped over + * some BOs because they were covered by dmem low protection, retry ``` Kernel convention would be: ```c + /* + * If we failed to find enough BOs to evict, but we skipped over + * some BOs because they were covered by dmem low protection, retry ``` --- Generated by Claude Code Patch Reviewer