From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: cgroup/dmem: Add queries for protection values Date: Fri, 27 Feb 2026 13:36:27 +1000 Message-ID: In-Reply-To: <20260225-dmemcg-aggressive-protect-v4-1-de847ab35184@gmx.de> References: <20260225-dmemcg-aggressive-protect-v4-0-de847ab35184@gmx.de> <20260225-dmemcg-aggressive-protect-v4-1-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 Clean addition of `dmem_cgroup_below_min()` and `dmem_cgroup_below_low()` as counterparts to memcg's equivalents. The comment explaining why `dmem_cgroup_calculate_protection()` is needed here (unlike memcg which calculates during tree traversal) is excellent and very helpful for future maintainers: ```c + /* + * In mem_cgroup_below_min(), the memcg pendant, this call is missing. + * mem_cgroup_below_min() gets called during traversal of the cgroup tree, where + * protection is already calculated as part of the traversal. dmem cgroup eviction + * does not traverse the cgroup tree, so we need to recalculate effective protection + * here. + */ + dmem_cgroup_calculate_protection(root, test); ``` The root-finding loop is correct and the early return for `root == test || !pool_parent(test)` is appropriate. The inline stubs returning `false` when `CONFIG_CGROUP_DMEM` is disabled are correct. No issues with this patch. --- Generated by Claude Code Patch Reviewer