From: Yafang Shao <laoar.shao@gmail.com>
To: 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,
vschneid@redhat.com
Cc: linux-kernel@vger.kernel.org, Yafang Shao <laoar.shao@gmail.com>
Subject: [PATCH 0/3] sched: Fix irq accounting for CONFIG_IRQ_TIME_ACCOUNTING
Date: Mon, 23 Sep 2024 17:00:25 +0800 [thread overview]
Message-ID: <20240923090028.16368-1-laoar.shao@gmail.com> (raw)
After enabling CONFIG_IRQ_TIME_ACCOUNTING to track IRQ pressure in our
container environment, we encountered several user-visible behavioral
changes:
- Interrupted IRQ/softirq time is not accounted for in the cpuacct cgroup
This breaks userspace applications that rely on CPU usage data from
cgroups to monitor CPU pressure. This patchset resolves the issue by
ensuring that IRQ/softirq time is accounted for in the cgroup of the
interrupted tasks.
- getrusage(2) does not include time interrupted by IRQ/softirq
Some services use getrusage(2) to check if workloads are experiencing CPU
pressure. Since IRQ/softirq time is no longer charged to task runtime,
getrusage(2) can no longer reflect the CPU pressure caused by heavy
interrupts.
This patchset addresses the first issue, which is relatively
straightforward. However, the second issue remains unresolved, as there
might be debate over whether interrupted time should be considered part of
a task’s usage. Nonetheless, it is important to report interrupted time to
the user via some metric, though that is a separate discussion.
Yafang Shao (3):
sched: Fix cgroup irq accounting for CONFIG_IRQ_TIME_ACCOUNTING
sched: Define sched_clock_irqtime as static key
sched: Don't account irq time if sched_clock_irqtime is disabled
kernel/sched/core.c | 44 ++++++++++++++++++++++--------------------
kernel/sched/cputime.c | 26 +++++++++++++------------
kernel/sched/sched.h | 1 +
3 files changed, 38 insertions(+), 33 deletions(-)
--
2.43.5
next reply other threads:[~2024-09-23 9:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-23 9:00 Yafang Shao [this message]
2024-09-23 9:00 ` [PATCH 1/3] sched: Fix cgroup " Yafang Shao
2024-09-26 6:13 ` kernel test robot
2024-09-27 8:46 ` Yafang Shao
2024-09-23 9:00 ` [PATCH 2/3] sched: Define sched_clock_irqtime as static key Yafang Shao
2024-09-23 9:00 ` [PATCH 3/3] sched: Don't account irq time if sched_clock_irqtime is disabled Yafang Shao
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=20240923090028.16368-1-laoar.shao@gmail.com \
--to=laoar.shao@gmail.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--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®