mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cruz Zhao <CruzZhao@linux.alibaba.com>
To: tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org,
	mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	bristot@redhat.com, joshdon@google.com
Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 0/3] Accounting forced idle time per cpu and per cgroup
Date: Tue, 11 Jan 2022 17:55:58 +0800	[thread overview]
Message-ID: <1641894961-9241-1-git-send-email-CruzZhao@linux.alibaba.com> (raw)

There are two types of forced idle time: forced idle time from cookie'd 
task and forced idle time form uncookie'd task. The forced idle time from
uncookie'd task is actually caused by the cookie'd task in runqueue
indirectly, and it's more accurate to measure the capacity loss with the
sum of both.

This patch set accounts forced idle time for each cpu to measure how long
the cpu is forced idle, which is displayed via via /proc/schedstat, and
also accounts for each cgroup to measure how long it forced its SMT siblings
into idle, which is displayed via /sys/fs/cgroup/cpuacct/cpuacct.forceidle
and /sys/fs/cgroup/cpuacct/cpuacct.forceidle_percpu. It is worth noting that
the forced idle time and the force idle time have different meanings.

We can get the total system forced idle time by looking at the root cgroup,
and we can get how long the cgroup forced it SMT siblings into idle. If the
force idle time of a cgroup is high, that can be rectified by making some
changes(ie. affinity, cpu budget, etc.) to the cgroup.

Cruz Zhao (3):
  sched/core: Accounting forceidle time for all tasks except idle task
  sched/core: Forced idle accounting per-cpu
  sched/core: Force idle accounting per cgroup

 include/linux/cgroup.h    |  7 +++++
 kernel/sched/core.c       | 10 ++++--
 kernel/sched/core_sched.c | 10 ++++--
 kernel/sched/cpuacct.c    | 79 +++++++++++++++++++++++++++++++++++++++++++++++
 kernel/sched/sched.h      |  4 +++
 kernel/sched/stats.c      | 17 ++++++++--
 6 files changed, 119 insertions(+), 8 deletions(-)

-- 
1.8.3.1


             reply	other threads:[~2022-01-11  9:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11  9:55 Cruz Zhao [this message]
2022-01-11  9:55 ` [PATCH v2 1/3] sched/core: Accounting forceidle time for all tasks except idle task Cruz Zhao
2022-01-11 23:52   ` Josh Don
2022-01-18 11:18   ` [tip: sched/urgent] " tip-bot2 for Cruz Zhao
2022-01-11  9:56 ` [PATCH v2 2/3] sched/core: Forced idle accounting per-cpu Cruz Zhao
2022-01-12  1:59   ` Josh Don
2022-01-14 15:04     ` cruzzhao
2022-01-14 23:40       ` Josh Don
2022-01-12 12:27   ` Peter Zijlstra
2022-01-14 11:06     ` cruzzhao
2022-01-11  9:56 ` [PATCH v2 3/3] sched/core: Force idle accounting per cgroup Cruz Zhao
2022-01-12 20:42   ` Tejun Heo
2022-01-14 11:13     ` cruzzhao
2022-01-14 16:39       ` 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=1641894961-9241-1-git-send-email-CruzZhao@linux.alibaba.com \
    --to=cruzzhao@linux.alibaba.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=cgroups@vger.kernel.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=hannes@cmpxchg.org \
    --cc=joshdon@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    /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®