process.c (7e4d960993331e92567f0180e45322a93e6780ba) process.c (37f08be11be9a7d9351fb1b9b408259519a126f3)
1/*
2 * drivers/power/process.c - Functions for starting/stopping processes on
3 * suspend transitions.
4 *
5 * Originally from swsusp.
6 */
7
8

--- 39 unchanged lines hidden (view full) ---

48 continue;
49
50 /*
51 * Now that we've done set_freeze_flag, don't
52 * perturb a task in TASK_STOPPED or TASK_TRACED.
53 * It is "frozen enough". If the task does wake
54 * up, it will immediately call try_to_freeze.
55 *
1/*
2 * drivers/power/process.c - Functions for starting/stopping processes on
3 * suspend transitions.
4 *
5 * Originally from swsusp.
6 */
7
8

--- 39 unchanged lines hidden (view full) ---

48 continue;
49
50 /*
51 * Now that we've done set_freeze_flag, don't
52 * perturb a task in TASK_STOPPED or TASK_TRACED.
53 * It is "frozen enough". If the task does wake
54 * up, it will immediately call try_to_freeze.
55 *
56 * Because freeze_task() goes through p's
57 * scheduler lock after setting TIF_FREEZE, it's
58 * guaranteed that either we see TASK_RUNNING or
59 * try_to_stop() after schedule() in ptrace/signal
60 * stop sees TIF_FREEZE.
56 * Because freeze_task() goes through p's scheduler lock, it's
57 * guaranteed that TASK_STOPPED/TRACED -> TASK_RUNNING
58 * transition can't race with task state testing here.
61 */
62 if (!task_is_stopped_or_traced(p) &&
63 !freezer_should_skip(p))
64 todo++;
65 } while_each_thread(g, p);
66 read_unlock(&tasklist_lock);
67
68 if (!user_only) {

--- 24 unchanged lines hidden (view full) ---

93 if (todo) {
94 printk("\n");
95 printk(KERN_ERR "Freezing of tasks %s after %d.%02d seconds "
96 "(%d tasks refusing to freeze, wq_busy=%d):\n",
97 wakeup ? "aborted" : "failed",
98 elapsed_csecs / 100, elapsed_csecs % 100,
99 todo - wq_busy, wq_busy);
100
59 */
60 if (!task_is_stopped_or_traced(p) &&
61 !freezer_should_skip(p))
62 todo++;
63 } while_each_thread(g, p);
64 read_unlock(&tasklist_lock);
65
66 if (!user_only) {

--- 24 unchanged lines hidden (view full) ---

91 if (todo) {
92 printk("\n");
93 printk(KERN_ERR "Freezing of tasks %s after %d.%02d seconds "
94 "(%d tasks refusing to freeze, wq_busy=%d):\n",
95 wakeup ? "aborted" : "failed",
96 elapsed_csecs / 100, elapsed_csecs % 100,
97 todo - wq_busy, wq_busy);
98
101 read_lock(&tasklist_lock);
102 do_each_thread(g, p) {
103 if (!wakeup && !freezer_should_skip(p) &&
104 p != current && freezing(p) && !frozen(p))
105 sched_show_task(p);
106 } while_each_thread(g, p);
107 read_unlock(&tasklist_lock);
99 if (!wakeup) {
100 read_lock(&tasklist_lock);
101 do_each_thread(g, p) {
102 if (p != current && !freezer_should_skip(p)
103 && freezing(p) && !frozen(p))
104 sched_show_task(p);
105 } while_each_thread(g, p);
106 read_unlock(&tasklist_lock);
107 }
108 } else {
109 printk("(elapsed %d.%02d seconds) ", elapsed_csecs / 100,
110 elapsed_csecs % 100);
111 }
112
113 return todo ? -EBUSY : 0;
114}
115

--- 97 unchanged lines hidden ---
108 } else {
109 printk("(elapsed %d.%02d seconds) ", elapsed_csecs / 100,
110 elapsed_csecs % 100);
111 }
112
113 return todo ? -EBUSY : 0;
114}
115

--- 97 unchanged lines hidden ---