Skip to content

Suppress warning on resume attempt of explicitly frozen processes

Michal Dubiel linux-pm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2kernel/freezer: Add routine to read task's freezing reasoninclude/linux/freezer.h kernel/freezer.c+33 -72 replies
2/2kernel/freezer: Don't warn when thawing freezing cgroup processeskernel/freezer.c+6 -10 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/2] Suppress warning on resume attempt of explicitly frozen processes

Hi,

The following patches disable warning message for thawing attempts of processes that belong to a cgroup that has been intentionally frozen. This happens in the following example situation:
1. A cgroup is frozen by writing "FROZEN" to freezer.state cgroupfs file.
2. System goes to suspend.
3. System resumes from suspension.
4. The cgroup is thawed by writing "TWAWED" to freezer.state cgroupfs file.

On 3, kernel tries to thaw the frozen processes. However, the processes of the freezing cgroup should not be thawed in that step, but rather in 4, when the user requests it. That is the case and kernel skips thawing of the processes but it also warns about that it tried to thaw a process that is in freezing state. It seems that the warning is not necessary for the case explained above and the thawing of a process of freezing cgroup should be just skipped. This exact scenario is common in ChromeOS, where a separate daemon is used to freeze processes belonging to certain cgroups in specific order before systems go to suspend and then waking them up after system resumes.

The first patch of the series adds a function to check for the reason why the task is freezing. That function is then used by the second patch to suppress the warning for freezing cgroup's processes.

An alternative would be to simply add an "if (cgroup_freezing())" statement directly in __thaw_task(). However, cgroup_freezing() does not check if freezer is active (what the freezing() function does before calling cgroup_freezing()). That would still work as the freezer is actually active when __thaw_task() is called, but it would be more of a hack than a clean solution. By having a dedicated function for obtaining the task's freezing reason it can be done in a more clean way.

I would appreciate any comments or remarks.

Regards,
Michal

Michal Dubiel (2):
kernel/freezer: Add routine to read task's freezing reason kernel/freezer: Don't warn when thawing freezing cgroup processes

 include/linux/freezer.h | 17 +++++++++++
 kernel/freezer.c        | 30 ++++++++++++++------
 2 files changed, 39 insertions(+), 8 deletions(-)

--
2.39.2.722.g9855ee24e9-goog