Re: [RFC PATCH] cgroup: Track time in cgroup v2 freezer

From: Tejun Heo
Date: Tue Jun 03 2025 - 19:04:01 EST


On Tue, Jun 03, 2025 at 10:43:05PM +0000, Tiffany Yang wrote:
> The cgroup v2 freezer controller allows user processes to be dynamically
> added to and removed from an interruptible frozen state from
> userspace. This feature is helpful for application management, as it
> allows background tasks to be frozen to prevent them from being
> scheduled or otherwise contending with foreground tasks for resources.
> Still, applications are usually unaware of their having been placed in
> the freezer cgroup, so any watchdog timers they may have set will fire
> when they exit. To address this problem, I propose tracking the per-task
> frozen time and exposing it to userland via procfs.

Just on a glance, it feels rather odd to be tracking this per task given
that the state is per cgroup. Can you account this per cgroup?

Thanks.

--
tejun