diff options
-rw-r--r-- | include/linux/freezer.h | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index 30f06c220467..7bcfe73d999b 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
@@ -67,33 +67,27 @@ static inline bool cgroup_freezing(struct task_struct *task) | |||
67 | * appropriately in case the child has exited before the freezing of tasks is | 67 | * appropriately in case the child has exited before the freezing of tasks is |
68 | * complete. However, we don't want kernel threads to be frozen in unexpected | 68 | * complete. However, we don't want kernel threads to be frozen in unexpected |
69 | * places, so we allow them to block freeze_processes() instead or to set | 69 | * places, so we allow them to block freeze_processes() instead or to set |
70 | * PF_NOFREEZE if needed and PF_FREEZER_SKIP is only set for userland vfork | 70 | * PF_NOFREEZE if needed. Fortunately, in the ____call_usermodehelper() case the |
71 | * parents. Fortunately, in the ____call_usermodehelper() case the parent won't | 71 | * parent won't really block freeze_processes(), since ____call_usermodehelper() |
72 | * really block freeze_processes(), since ____call_usermodehelper() (the child) | 72 | * (the child) does a little before exec/exit and it can't be frozen before |
73 | * does a little before exec/exit and it can't be frozen before waking up the | 73 | * waking up the parent. |
74 | * parent. | ||
75 | */ | 74 | */ |
76 | 75 | ||
77 | /* | 76 | |
78 | * If the current task is a user space one, tell the freezer not to count it as | 77 | /* Tell the freezer not to count the current task as freezable. */ |
79 | * freezable. | ||
80 | */ | ||
81 | static inline void freezer_do_not_count(void) | 78 | static inline void freezer_do_not_count(void) |
82 | { | 79 | { |
83 | if (current->mm) | 80 | current->flags |= PF_FREEZER_SKIP; |
84 | current->flags |= PF_FREEZER_SKIP; | ||
85 | } | 81 | } |
86 | 82 | ||
87 | /* | 83 | /* |
88 | * If the current task is a user space one, tell the freezer to count it as | 84 | * Tell the freezer to count the current task as freezable again and try to |
89 | * freezable again and try to freeze it. | 85 | * freeze it. |
90 | */ | 86 | */ |
91 | static inline void freezer_count(void) | 87 | static inline void freezer_count(void) |
92 | { | 88 | { |
93 | if (current->mm) { | 89 | current->flags &= ~PF_FREEZER_SKIP; |
94 | current->flags &= ~PF_FREEZER_SKIP; | 90 | try_to_freeze(); |
95 | try_to_freeze(); | ||
96 | } | ||
97 | } | 91 | } |
98 | 92 | ||
99 | /* | 93 | /* |