]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - kernel/power/process.c
Freezer: Fix a race during freezing of TASK_STOPPED tasks
[mirror_ubuntu-zesty-kernel.git] / kernel / power / process.c
index e50b4c1b2a0f7f8943acb041b5d8ab202c40d5cd..eb2c88a9e5623efcbcd16b6a6c90fd2e19497885 100644 (file)
@@ -64,6 +64,12 @@ static int try_to_freeze_tasks(bool sig_only)
                         * perturb a task in TASK_STOPPED or TASK_TRACED.
                         * It is "frozen enough".  If the task does wake
                         * up, it will immediately call try_to_freeze.
+                        *
+                        * Because freeze_task() goes through p's
+                        * scheduler lock after setting TIF_FREEZE, it's
+                        * guaranteed that either we see TASK_RUNNING or
+                        * try_to_stop() after schedule() in ptrace/signal
+                        * stop sees TIF_FREEZE.
                         */
                        if (!task_is_stopped_or_traced(p) &&
                            !freezer_should_skip(p))