[fixlet] mm/vmpressure: skip tree=true accounting on cgroup v2
From: Usama Arif
Date: Tue Jun 30 2026 - 12:25:05 EST
Simplify the guard. Both cgroup_subsys_on_dfl() and tree are bool, so
the two combinations that have no consumer (v1 + tree=false, v2 +
tree=true) are exactly the cases where dfl == tree.
Suggested-by: Johannes Weiner <hannes@xxxxxxxxxxx>
Signed-off-by: Usama Arif <usama.arif@xxxxxxxxx>
---
mm/vmpressure.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/vmpressure.c b/mm/vmpressure.c
index 14470141bbe6..9629240d77ad 100644
--- a/mm/vmpressure.c
+++ b/mm/vmpressure.c
@@ -120,8 +120,7 @@ void vmpressure(gfp_t gfp, int order, struct mem_cgroup *memcg, bool tree,
* cgroup v1 + tree=true -> userspace eventfds (memory.pressure_level)
* Skip the other two: nothing consumes the result.
*/
- if ((!cgroup_subsys_on_dfl(memory_cgrp_subsys) && !tree) ||
- (cgroup_subsys_on_dfl(memory_cgrp_subsys) && tree))
+ if (cgroup_subsys_on_dfl(memory_cgrp_subsys) == tree)
return;
vmpr = memcg_to_vmpressure(memcg);
--
2.53.0-Meta