mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
freezer: test freezable conditions while holding freezer_lock
try_to_freeze_tasks() and thaw_processes() use freezable() and
frozen() as preliminary tests before initiating operations on a task.
These are done without any synchronization and hinder with
synchronization cleanup without any real performance benefits.
In try_to_freeze_tasks(), open code self test and move PF_NOFREEZE and
frozen() tests inside freezer_lock in freeze_task().
thaw_processes() can simply drop freezable() test as frozen() test in
__thaw_task() is enough.
Note: This used to be a part of larger patch to fix set_freezable()
race. Separated out to satisfy ordering among dependent fixes.
Signed-off-by: Tejun Heo <[email protected]>
Cc: Oleg Nesterov <[email protected]>
This commit is contained in:
parent
6907483b4e
commit
85f1d47665
2 changed files with 3 additions and 16 deletions
|
|
@ -109,7 +109,8 @@ bool freeze_task(struct task_struct *p, bool sig_only)
|
|||
|
||||
spin_lock_irqsave(&freezer_lock, flags);
|
||||
|
||||
if (sig_only && !should_send_signal(p))
|
||||
if ((p->flags & PF_NOFREEZE) ||
|
||||
(sig_only && !should_send_signal(p)))
|
||||
goto out_unlock;
|
||||
|
||||
if (frozen(p))
|
||||
|
|
|
|||
Loading…
Reference in a new issue