aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/cgroups/freezer-subsystem.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/cgroups/freezer-subsystem.txt')
-rw-r--r--Documentation/cgroups/freezer-subsystem.txt63
1 files changed, 42 insertions, 21 deletions
diff --git a/Documentation/cgroups/freezer-subsystem.txt b/Documentation/cgroups/freezer-subsystem.txt
index 7e62de1e59ff..c96a72cbb30a 100644
--- a/Documentation/cgroups/freezer-subsystem.txt
+++ b/Documentation/cgroups/freezer-subsystem.txt
@@ -49,13 +49,49 @@ prevent the freeze/unfreeze cycle from becoming visible to the tasks
49being frozen. This allows the bash example above and gdb to run as 49being frozen. This allows the bash example above and gdb to run as
50expected. 50expected.
51 51
52The freezer subsystem in the container filesystem defines a file named 52The cgroup freezer is hierarchical. Freezing a cgroup freezes all
53freezer.state. Writing "FROZEN" to the state file will freeze all tasks in the 53tasks beloning to the cgroup and all its descendant cgroups. Each
54cgroup. Subsequently writing "THAWED" will unfreeze the tasks in the cgroup. 54cgroup has its own state (self-state) and the state inherited from the
55Reading will return the current state. 55parent (parent-state). Iff both states are THAWED, the cgroup is
56THAWED.
56 57
57Note freezer.state doesn't exist in root cgroup, which means root cgroup 58The following cgroupfs files are created by cgroup freezer.
58is non-freezable. 59
60* freezer.state: Read-write.
61
62 When read, returns the effective state of the cgroup - "THAWED",
63 "FREEZING" or "FROZEN". This is the combined self and parent-states.
64 If any is freezing, the cgroup is freezing (FREEZING or FROZEN).
65
66 FREEZING cgroup transitions into FROZEN state when all tasks
67 belonging to the cgroup and its descendants become frozen. Note that
68 a cgroup reverts to FREEZING from FROZEN after a new task is added
69 to the cgroup or one of its descendant cgroups until the new task is
70 frozen.
71
72 When written, sets the self-state of the cgroup. Two values are
73 allowed - "FROZEN" and "THAWED". If FROZEN is written, the cgroup,
74 if not already freezing, enters FREEZING state along with all its
75 descendant cgroups.
76
77 If THAWED is written, the self-state of the cgroup is changed to
78 THAWED. Note that the effective state may not change to THAWED if
79 the parent-state is still freezing. If a cgroup's effective state
80 becomes THAWED, all its descendants which are freezing because of
81 the cgroup also leave the freezing state.
82
83* freezer.self_freezing: Read only.
84
85 Shows the self-state. 0 if the self-state is THAWED; otherwise, 1.
86 This value is 1 iff the last write to freezer.state was "FROZEN".
87
88* freezer.parent_freezing: Read only.
89
90 Shows the parent-state. 0 if none of the cgroup's ancestors is
91 frozen; otherwise, 1.
92
93The root cgroup is non-freezable and the above interface files don't
94exist.
59 95
60* Examples of usage : 96* Examples of usage :
61 97
@@ -85,18 +121,3 @@ to unfreeze all tasks in the container :
85 121
86This is the basic mechanism which should do the right thing for user space task 122This is the basic mechanism which should do the right thing for user space task
87in a simple scenario. 123in a simple scenario.
88
89It's important to note that freezing can be incomplete. In that case we return
90EBUSY. This means that some tasks in the cgroup are busy doing something that
91prevents us from completely freezing the cgroup at this time. After EBUSY,
92the cgroup will remain partially frozen -- reflected by freezer.state reporting
93"FREEZING" when read. The state will remain "FREEZING" until one of these
94things happens:
95
96 1) Userspace cancels the freezing operation by writing "THAWED" to
97 the freezer.state file
98 2) Userspace retries the freezing operation by writing "FROZEN" to
99 the freezer.state file (writing "FREEZING" is not legal
100 and returns EINVAL)
101 3) The tasks that blocked the cgroup from entering the "FROZEN"
102 state disappear from the cgroup's set of tasks.