All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] sched: Fix irq accounting for CONFIG_IRQ_TIME_ACCOUNTING
@ 2024-10-08  6:19 Yafang Shao
  2024-10-08  6:19 ` [PATCH v2 1/4] sched: Define sched_clock_irqtime as static key Yafang Shao
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Yafang Shao @ 2024-10-08  6:19 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, vschneid, hannes, surenb
  Cc: cgroups, linux-kernel, Yafang Shao

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.

Changes:
v1->v2: 
- Fix lockdep issues reported by kernel test robot <oliver.sang@intel.com> 

v1: https://lore.kernel.org/all/20240923090028.16368-1-laoar.shao@gmail.com/

Yafang Shao (4):
  sched: Define sched_clock_irqtime as static key
  sched: Don't account irq time if sched_clock_irqtime is disabled
  sched, psi: Don't account irq time if sched_clock_irqtime is disabled
  sched: Fix cgroup irq accounting for CONFIG_IRQ_TIME_ACCOUNTING

 kernel/sched/core.c    | 83 ++++++++++++++++++++++++++++++------------
 kernel/sched/cputime.c | 16 ++++----
 kernel/sched/psi.c     | 12 +-----
 kernel/sched/sched.h   |  1 +
 kernel/sched/stats.h   |  7 ++--
 5 files changed, 74 insertions(+), 45 deletions(-)

-- 
2.43.5


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-10-09 11:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-08  6:19 [PATCH v2 0/4] sched: Fix irq accounting for CONFIG_IRQ_TIME_ACCOUNTING Yafang Shao
2024-10-08  6:19 ` [PATCH v2 1/4] sched: Define sched_clock_irqtime as static key Yafang Shao
2024-10-08  6:19 ` [PATCH v2 2/4] sched: Don't account irq time if sched_clock_irqtime is disabled Yafang Shao
2024-10-08  6:19 ` [PATCH v2 3/4] sched, psi: " Yafang Shao
2024-10-08 14:04   ` Johannes Weiner
2024-10-08  6:19 ` [PATCH v2 4/4] sched: Fix cgroup irq accounting for CONFIG_IRQ_TIME_ACCOUNTING Yafang Shao
2024-10-08 14:23   ` Johannes Weiner
2024-10-09 11:40     ` Yafang Shao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.