aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/power
diff options
context:
space:
mode:
authorSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>2012-02-04 16:26:26 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2012-02-09 17:55:49 -0500
commit9045a05044268b075c13bb0284601b24959dc3c6 (patch)
tree4fc43dc0e901f565e37219ba59ea305409fb8be7 /Documentation/power
parent8916e3702ec422b57cc549fbae3986106292100f (diff)
PM / Freezer / Docs: Document the beauty of freeze/thaw semantics
The way the different freeze/thaw functions encapsulate each other are quite lovely from a design point of view. And as a side-effect, the way in which they are invoked (cleaning up on failure for example) differs significantly from how usual functions are dealt with. This is because of the underlying semantics that govern the freezing and thawing of various tasks. This subtle aspect that differentiates these functions from the rest, is worth documenting. Many thanks to Tejun Heo for providing enlightenment on this topic. Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'Documentation/power')
-rw-r--r--Documentation/power/freezing-of-tasks.txt21
1 files changed, 21 insertions, 0 deletions
diff --git a/Documentation/power/freezing-of-tasks.txt b/Documentation/power/freezing-of-tasks.txt
index ebd7490ef1df..ec715cd78fbb 100644
--- a/Documentation/power/freezing-of-tasks.txt
+++ b/Documentation/power/freezing-of-tasks.txt
@@ -63,6 +63,27 @@ devices have been reinitialized, the function thaw_processes() is called in
63order to clear the PF_FROZEN flag for each frozen task. Then, the tasks that 63order to clear the PF_FROZEN flag for each frozen task. Then, the tasks that
64have been frozen leave __refrigerator() and continue running. 64have been frozen leave __refrigerator() and continue running.
65 65
66
67Rationale behind the functions dealing with freezing and thawing of tasks:
68-------------------------------------------------------------------------
69
70freeze_processes():
71 - freezes only userspace tasks
72
73freeze_kernel_threads():
74 - freezes all tasks (including kernel threads) because we can't freeze
75 kernel threads without freezing userspace tasks
76
77thaw_kernel_threads():
78 - thaws only kernel threads; this is particularly useful if we need to do
79 anything special in between thawing of kernel threads and thawing of
80 userspace tasks, or if we want to postpone the thawing of userspace tasks
81
82thaw_processes():
83 - thaws all tasks (including kernel threads) because we can't thaw userspace
84 tasks without thawing kernel threads
85
86
66III. Which kernel threads are freezable? 87III. Which kernel threads are freezable?
67 88
68Kernel threads are not freezable by default. However, a kernel thread may clear 89Kernel threads are not freezable by default. However, a kernel thread may clear