Commit 8821f363 authored by Friedrich Vock's avatar Friedrich Vock Committed by Maarten Lankhorst
Browse files

cgroup/dmem: Don't open-code css_for_each_descendant_pre



The current implementation has a bug: If the current css doesn't
contain any pool that is a descendant of the "pool" (i.e. when
found_descendant == false), then "pool" will point to some unrelated
pool. If the current css has a child, we'll overwrite parent_pool with
this unrelated pool on the next iteration.

Since we can just check whether a pool refers to the same region to
determine whether or not it's related, all the additional pool tracking
is unnecessary, so just switch to using css_for_each_descendant_pre for
traversal.

Fixes: b168ed45 ("kernel/cgroup: Add "dmem" memory accounting cgroup")
Signed-off-by: default avatarFriedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250127152754.21325-1-friedrich.vock@gmx.de


Signed-off-by: default avatarMaarten Lankhorst <dev@lankhorst.se>
parent b3fefbb3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment