Go to the documentation of this file.
3 #ifndef FREEZER_H_INCLUDED
4 #define FREEZER_H_INCLUDED
6 #include <linux/sched.h>
7 #include <linux/wait.h>
44 static inline bool try_to_freeze(
void)
55 #ifdef CONFIG_CGROUP_FREEZER
79 static inline void freezer_do_not_count(
void)
88 static inline void freezer_count(
void)
97 static inline int freezer_should_skip(
struct task_struct *p)
110 #define freezable_schedule() \
112 freezer_do_not_count(); \
118 #define freezable_schedule_timeout_killable(timeout) \
121 freezer_do_not_count(); \
122 __retval = schedule_timeout_killable(timeout); \
133 #define wait_event_freezekillable(wq, condition) \
136 freezer_do_not_count(); \
137 __retval = wait_event_killable(wq, (condition)); \
142 #define wait_event_freezable(wq, condition) \
146 __retval = wait_event_interruptible(wq, \
147 (condition) || freezing(current)); \
148 if (__retval || (condition)) \
155 #define wait_event_freezable_timeout(wq, condition, timeout) \
157 long __retval = timeout; \
159 __retval = wait_event_interruptible_timeout(wq, \
160 (condition) || freezing(current), \
162 if (__retval <= 0 || (condition)) \
170 static inline bool frozen(
struct task_struct *p) {
return false; }
171 static inline bool freezing(
struct task_struct *p) {
return false; }
174 static inline bool __refrigerator(
bool check_kthr_stop) {
return false; }
180 static inline bool try_to_freeze(
void) {
return false; }
182 static inline void freezer_do_not_count(
void) {}
183 static inline void freezer_count(
void) {}
184 static inline int freezer_should_skip(
struct task_struct *p) {
return 0; }
187 #define freezable_schedule() schedule()
189 #define freezable_schedule_timeout_killable(timeout) \
190 schedule_timeout_killable(timeout)
192 #define wait_event_freezable(wq, condition) \
193 wait_event_interruptible(wq, condition)
195 #define wait_event_freezable_timeout(wq, condition, timeout) \
196 wait_event_interruptible_timeout(wq, condition, timeout)
198 #define wait_event_freezekillable(wq, condition) \
199 wait_event_killable(wq, condition)