Re: [PATCH] cgroup/dmem: Don't clobber pool in dmem_cgroup_calculate_protection

2025-01-26 Thread Friedrich Vock
On 24.01.25 10:56, Michal Koutný wrote: On Fri, Jan 17, 2025 at 08:02:55PM +0100, Friedrich Vock wrote: Yeah, there are pools for the whole path between limit_pool and test_pool, but the issue is that we traverse the entire tree of cgroups, and we don't always stay on the path between limit_po

Re: [PATCH] cgroup/dmem: Don't clobber pool in dmem_cgroup_calculate_protection

2025-01-24 Thread Michal Koutný
On Fri, Jan 17, 2025 at 08:02:55PM +0100, Friedrich Vock wrote: > Yeah, there are pools for the whole path between limit_pool and > test_pool, but the issue is that we traverse the entire tree of cgroups, > and we don't always stay on the path between limit_pool and test_pool > (because we're ite

Re: [PATCH] cgroup/dmem: Don't clobber pool in dmem_cgroup_calculate_protection

2025-01-17 Thread Friedrich Vock
On 17.01.25 18:29, Michal Koutný wrote: On Thu, Jan 16, 2025 at 09:20:08AM +0100, Friedrich Vock wrote: These pools are allocated on-demand, so if a cgroup has not made any allocations for a specific device, there will be no pool corresponding to that device's memory. Here I understand. Po

Re: [PATCH] cgroup/dmem: Don't clobber pool in dmem_cgroup_calculate_protection

2025-01-17 Thread Michal Koutný
On Thu, Jan 16, 2025 at 09:20:08AM +0100, Friedrich Vock wrote: > These pools are allocated on-demand, so if a > cgroup has not made any allocations for a specific device, there will be > no pool corresponding to that device's memory. Here I understand. > Pools have a hierarchy of their own (th

Re: [PATCH] cgroup/dmem: Don't clobber pool in dmem_cgroup_calculate_protection

2025-01-16 Thread Friedrich Vock
Hi, On 14.01.25 16:58, Michal Koutný wrote: On Tue, Jan 14, 2025 at 04:39:12PM +0100, Friedrich Vock wrote: 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 h

Re: [PATCH] cgroup/dmem: Don't clobber pool in dmem_cgroup_calculate_protection

2025-01-14 Thread Michal Koutný
On Tue, Jan 14, 2025 at 04:39:12PM +0100, Friedrich Vock wrote: > 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

[PATCH] cgroup/dmem: Don't clobber pool in dmem_cgroup_calculate_protection

2025-01-14 Thread Friedrich Vock
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. Fix this by overwriting "