mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Hui Su <sh_def@163.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	K Prateek Nayak <kprateek.nayak@amd.com>,
	John Stultz <jstultz@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/cputime: Account cgroup fields to the scheduling context
Date: Thu, 3 Sep 2026 07:30:51 -1000	[thread overview]
Message-ID: <apmuywWz3c0keI2i@slm.duckdns.org> (raw)
In-Reply-To: <5733b51108eda90c1bda98a68d58b5e6ccbc24ec.1788433334.git.sh_def@163.com>

Hello, Hui.

On Thu, Sep 03, 2026 at 07:07:12PM +0800, Hui Su wrote:
> Proxy execution separates the scheduling context from the execution
> context. Scheduler runtime accounting charges cgroup time to the donor,
> while tick and vtime accounting use the execution task when updating
> cgroup fields.
> 
> When the donor and execution task belong to different cgroups, this can
> charge cpu.stat usage to the donor cgroup while charging cpu.stat user
> and system fields to the execution task's cgroup.
> 
> Before this fix, a reproducer with donor and execution tasks in separate
> cgroups showed the donor cgroup gaining usage time while the execution
> cgroup gained system time.

When these numbers are presented to the userspace, the user/sys split is
calculated out of usage_usec, so at least the presented numbers should be
coherent no matter what.

> Account cgroup fields to the scheduling context as well. Separate
> per-CPU cpustat accounting from cgroup field accounting so the former
> continues to follow the execution context while the latter follows the
> scheduling context.

I don't think it makes sense for cgroup's usage times to deviate from how
thread's get reported. Threads follow execution context. All cgroup numbers
should too. If you're worried about usage_usec not agreeing with e.g.
bandwidth control results, we can show donation time separately, but let's
worry about that later.

Thanks.

-- 
tejun

  reply	other threads:[~2026-09-03 17:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03 11:07 Hui Su
2026-09-03 17:30 ` Tejun Heo [this message]
2026-09-04  2:37   ` Hui Su
2026-09-04  6:27     ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=apmuywWz3c0keI2i@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=hannes@cmpxchg.org \
    --cc=jstultz@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sh_def@163.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®