Skip to content

cgroup: Track time in cgroup v2 freezer

Tiffany Yang cgroups linux-doc linux-kselftest lkml 4 versions – Applied

Status from this message: Applied to cgroup/for-6.18. Let's address further issues incrementally.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 9 repliesApplied
  2. v3 RFC2 patches 5 repliesSuperseded
  3. v2 RFC1 patch 17 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC1 patch10 repliesSuperseded

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/2cgroup: cgroup.stat.local time accountingDocumentation/admin-guide/cgroup-v2.rst include/linux/cgroup-defs.h kernel/cgroup/cgroup.c +1 more+75 -45 replies
2/2cgroup: selftests: Add tests for freezer timetools/testing/selftests/cgroup/test_freezer.c+663 -03 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/2] cgroup: Track time in cgroup v2 freezer

Hello,

The cgroup v2 freezer controller is useful for freezing background applications so they don't contend with foreground tasks. However, this may disrupt any internal monitoring that the application is performing, as it may not be aware that it was frozen.

To illustrate, an application might implement a watchdog thread to monitor a high-priority task by periodically checking its state to ensure progress. The challenge is that the task only advances when the application is running, but watchdog timers are set relative to system time, not app time. If the app is frozen and misses the expected deadline, the watchdog, unaware of this pause, may kill a healthy process.

This series tracks the time that each cgroup spends "freezing" and exposes it via cgroup.stat.local. Include several basic selftests to demonstrate the expected behavior of this interface, including that:
1. Freeze time will increase while a cgroup is freezing, regardless of whether it is frozen or not.
2. Each cgroup's freeze time is independent from the other cgroups in its hierarchy.

Thanks,
Tiffany

---
v3: https://lore.kernel.org/all/[email protected]/
v2: https://lore.kernel.org/lkml/[email protected]/
v1: https://lore.kernel.org/lkml/[email protected]/

Cc John Stultz <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Anna-Maria Behnsen <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Tejun Heo <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Michal Koutný <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Roman Gushchin <[email protected]>
Cc Chen Ridong <[email protected]>

Tiffany Yang (2):
cgroup: cgroup.stat.local time accounting
cgroup: selftests: Add tests for freezer time

 Documentation/admin-guide/cgroup-v2.rst       |  18 +
 include/linux/cgroup-defs.h                   |  17 +
 kernel/cgroup/cgroup.c                        |  28 +
 kernel/cgroup/freezer.c                       |  16 +-
 tools/testing/selftests/cgroup/test_freezer.c | 663 ++++++++++++++++++
 5 files changed, 738 insertions(+), 4 deletions(-)
Signature · 1 line
2.51.0.rc2.233.g662b1ed5c5-goog