aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/freezer.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/freezer.h')
-rw-r--r--include/linux/freezer.h29
1 files changed, 10 insertions, 19 deletions
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index 17e3bb42dd3c..8f225339eee9 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -46,26 +46,11 @@ static inline bool should_send_signal(struct task_struct *p)
46 46
47/* 47/*
48 * Wake up a frozen process 48 * Wake up a frozen process
49 *
50 * task_lock() is taken to prevent the race with refrigerator() which may
51 * occur if the freezing of tasks fails. Namely, without the lock, if the
52 * freezing of tasks failed, thaw_tasks() might have run before a task in
53 * refrigerator() could call frozen_process(), in which case the task would be
54 * frozen and no one would thaw it.
55 */ 49 */
56static inline int thaw_process(struct task_struct *p) 50extern int __thaw_process(struct task_struct *p);
57{ 51
58 task_lock(p); 52/* Takes and releases task alloc lock using task_lock() */
59 if (frozen(p)) { 53extern int thaw_process(struct task_struct *p);
60 p->flags &= ~PF_FROZEN;
61 task_unlock(p);
62 wake_up_process(p);
63 return 1;
64 }
65 clear_freeze_flag(p);
66 task_unlock(p);
67 return 0;
68}
69 54
70extern void refrigerator(void); 55extern void refrigerator(void);
71extern int freeze_processes(void); 56extern int freeze_processes(void);
@@ -83,6 +68,12 @@ static inline int try_to_freeze(void)
83extern bool freeze_task(struct task_struct *p, bool sig_only); 68extern bool freeze_task(struct task_struct *p, bool sig_only);
84extern void cancel_freezing(struct task_struct *p); 69extern void cancel_freezing(struct task_struct *p);
85 70
71#ifdef CONFIG_CGROUP_FREEZER
72extern int cgroup_frozen(struct task_struct *task);
73#else /* !CONFIG_CGROUP_FREEZER */
74static inline int cgroup_frozen(struct task_struct *task) { return 0; }
75#endif /* !CONFIG_CGROUP_FREEZER */
76
86/* 77/*
87 * The PF_FREEZER_SKIP flag should be set by a vfork parent right before it 78 * The PF_FREEZER_SKIP flag should be set by a vfork parent right before it
88 * calls wait_for_completion(&vfork) and reset right after it returns from this 79 * calls wait_for_completion(&vfork) and reset right after it returns from this