Commit 4d45d195 authored by Tiffany Yang's avatar Tiffany Yang Committed by Treehugger Robot
Browse files

BACKPORT: FROMGIT: cgroup: cgroup.stat.local time accounting



There isn't yet a clear way to identify a set of "lost" time that
everyone (or at least a wider group of users) cares about. However,
users can perform some delay accounting by iterating over components of
interest. This patch allows cgroup v2 freezing time to be one of those
components.

Track the cumulative time that each v2 cgroup spends freezing and expose
it to userland via a new local stat file in cgroupfs. Thank you to
Michal, who provided the ASCII art in the updated documentation.

To access this value:
  $ mkdir /sys/fs/cgroup/test
  $ cat /sys/fs/cgroup/test/cgroup.stat.local
  freeze_time_total 0

Ensure consistent freeze time reads with freeze_seq, a per-cgroup
sequence counter. Writes are serialized using the css_set_lock.

Signed-off-by: default avatarTiffany Yang <ynaffit@google.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Michal Koutný <mkoutny@suse.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Change-Id: Ied8f9304e5f04a6f0c8d7b7afcfb0cc12bf7bf40
Bug: 404952324
(cherry picked from commit afa3701c
https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git

 for-6.18)
[ynaffit: fix trivial merge conflict in cgroup_freeze]
Signed-off-by: default avatarTiffany Yang <ynaffit@google.com>
parent 8dad1dda
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment