Skip to content

Commit 78f6519

Browse files
Werkovhtejun
authored andcommitted
cgroup: Add deprecation message to legacy freezer controller
As explained in the commit 76f969e ("cgroup: cgroup v2 freezer"), the original freezer is imperfect, some users may unwittingly rely on it when there exists the alternative of v2. Print a message when it happens and explain that in the docs. Signed-off-by: Michal Koutný <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent fd4fd0a commit 78f6519

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Documentation/admin-guide/cgroup-v1/freezer-subsystem.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,7 @@ to unfreeze all tasks in the container::
125125

126126
This is the basic mechanism which should do the right thing for user space task
127127
in a simple scenario.
128+
129+
This freezer implementation is affected by shortcomings (see commit
130+
76f969e8948d8 ("cgroup: cgroup v2 freezer")) and cgroup v2 freezer is
131+
recommended.

kernel/cgroup/legacy_freezer.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,11 @@ static ssize_t freezer_write(struct kernfs_open_file *of,
430430

431431
if (strcmp(buf, freezer_state_strs(0)) == 0)
432432
freeze = false;
433-
else if (strcmp(buf, freezer_state_strs(CGROUP_FROZEN)) == 0)
433+
else if (strcmp(buf, freezer_state_strs(CGROUP_FROZEN)) == 0) {
434+
pr_info_once("Freezing with imperfect legacy cgroup freezer. "
435+
"See cgroup.freeze of cgroup v2\n");
434436
freeze = true;
435-
else
437+
} else
436438
return -EINVAL;
437439

438440
freezer_change_state(css_freezer(of_css(of)), freeze);

0 commit comments

Comments
 (0)