lkml.org 
[lkml]   [2023]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] cgroup/rstat: Record the cumulative per-cpu time of cgroup and its descendants
On Mon, Aug 07, 2023 at 11:29:30AM +0800, Hao Jia wrote:
> The member variable bstat of the structure cgroup_rstat_cpu
> records the per-cpu time of the cgroup itself, but does not
> include the per-cpu time of its descendants. The per-cpu time
> including descendants is very useful for calculating the
> per-cpu usage of cgroups.
>
> Although we can indirectly obtain the total per-cpu time
> of the cgroup and its descendants by accumulating the per-cpu
> bstat of each descendant of the cgroup. But after a child cgroup
> is removed, we will lose its bstat information. This will cause
> the cumulative value to be non-monotonic, thus affecting
> the accuracy of cgroup per-cpu usage.
>
> So we add the subtree_bstat variable to record the total
> per-cpu time of this cgroup and its descendants, which is
> similar to "cpuacct.usage*" in cgroup v1. And this is
> also helpful for the migration from cgroup v1 to cgroup v2.
> After adding this variable, we can obtain the per-cpu time of
> cgroup and its descendants in user mode through eBPF/drgn, etc.
> And we are still trying to determine how to expose it in the
> cgroupfs interface.
>
> Suggested-by: Tejun Heo <tj@kernel.org>
> Signed-off-by: Hao Jia <jiahao.os@bytedance.com>

Applied to cgroup/for-6.6.

Thanks.

--
tejun

\
 
 \ /
  Last update: 2023-08-07 20:42    [W:0.205 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site