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: Tue, 03 Mar 2026 13:29:38 +1000 Message-ID: In-Reply-To: <20260302-dmemcg-aggressive-protect-v5-1-ffd3a2602309@gmx.de> References: <20260302-dmemcg-aggressive-protect-v5-0-ffd3a2602309@gmx.de> <20260302-dmemcg-aggressive-protect-v5-1-ffd3a2602309@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 **Purpose:** Adds `dmem_cgroup_below_min()` and `dmem_cgroup_below_low()` t= o query whether a pool's usage is within its protection limits. These mirro= r memcg's `mem_cgroup_below_{min,low}`. **Review:** Clean and straightforward. The functions follow the established= memcg pattern. The key difference from memcg (calling `dmem_cgroup_calcula= te_protection()` explicitly) is well-documented. Minor nit =E2=80=94 the comment uses the word "pendant" (German for counter= part): ```c * In mem_cgroup_below_min(), the memcg pendant, this call is missing. ``` Should be "counterpart" in English. This appears in both functions. The two functions are nearly identical except for `emin` vs `elow`: ```c return page_counter_read(&test->cnt) <=3D READ_ONCE(test->cnt.emin); ``` vs: ```c return page_counter_read(&test->cnt) <=3D READ_ONCE(test->cnt.elow); ``` This duplication follows the memcg convention so it's acceptable, but a sha= red helper with a flag parameter could reduce duplication. The `#else` stubs returning `false` are correct =E2=80=94 without cgroup su= pport, nothing is "protected." --- Generated by Claude Code Patch Reviewer