Re: [PATCH] sched/cputime: Account cgroup fields to the scheduling context

From: Tejun Heo

Date: Fri Sep 04 2026 - 02:41:40 EST


Hello,

On Fri, Sep 04, 2026 at 10:37:05AM +0800, Hui Su wrote:
> You're right that cputime_adjust() reconciles the user/system split
> against the total usage, so my description of this as a user-visible
> cpu.stat inconsistency was too strong.
>
> My patch followed the cgroup accounting behavior introduced by
> aa4f74dfd42b, where cgroup_account_cputime() charges CPU time to the
> donor, and tried to make the tick and vtime cgroup field accounting
> follow the same context.
>
> Following your suggestion, the simpler fix is to make cgroup CPU usage
> follow the execution context as well, matching the per-task and
> thread-group accounting. That would also let me drop the cputime boundary
> and donor lifetime machinery from this patch.

cgroup accounting deviating from task accounting doesn't seem to make sense
to me but I haven't thought too much about proxy execution, so let's hear
what John has to say.

Thanks.

--
tejun