Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43753e58 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branch 'pm-freezer' into pm-sleep

* pm-freezer:
  PM / Freezer: Remove the "userspace only" constraint from freezer[_do_not]_count()
parents e5b16746 467de1fc
Loading
Loading
Loading
Loading
+11 −17
Original line number Original line Diff line number Diff line
@@ -67,34 +67,28 @@ static inline bool cgroup_freezing(struct task_struct *task)
 * appropriately in case the child has exited before the freezing of tasks is
 * appropriately in case the child has exited before the freezing of tasks is
 * complete.  However, we don't want kernel threads to be frozen in unexpected
 * complete.  However, we don't want kernel threads to be frozen in unexpected
 * places, so we allow them to block freeze_processes() instead or to set
 * places, so we allow them to block freeze_processes() instead or to set
 * PF_NOFREEZE if needed and PF_FREEZER_SKIP is only set for userland vfork
 * PF_NOFREEZE if needed. Fortunately, in the ____call_usermodehelper() case the
 * parents.  Fortunately, in the ____call_usermodehelper() case the parent won't
 * parent won't really block freeze_processes(), since ____call_usermodehelper()
 * really block freeze_processes(), since ____call_usermodehelper() (the child)
 * (the child) does a little before exec/exit and it can't be frozen before
 * does a little before exec/exit and it can't be frozen before waking up the
 * waking up the parent.
 * parent.
 */
 */


/*

 * If the current task is a user space one, tell the freezer not to count it as
/* Tell the freezer not to count the current task as freezable. */
 * freezable.
 */
static inline void freezer_do_not_count(void)
static inline void freezer_do_not_count(void)
{
{
	if (current->mm)
	current->flags |= PF_FREEZER_SKIP;
	current->flags |= PF_FREEZER_SKIP;
}
}


/*
/*
 * If the current task is a user space one, tell the freezer to count it as
 * Tell the freezer to count the current task as freezable again and try to
 * freezable again and try to freeze it.
 * freeze it.
 */
 */
static inline void freezer_count(void)
static inline void freezer_count(void)
{
{
	if (current->mm) {
	current->flags &= ~PF_FREEZER_SKIP;
	current->flags &= ~PF_FREEZER_SKIP;
	try_to_freeze();
	try_to_freeze();
}
}
}


/*
/*
 * Check if the task should be counted as freezable by the freezer
 * Check if the task should be counted as freezable by the freezer