FROMGIT: freezer,sched: clean saved_state when restoring it during thaw

Clean saved_state after using it during thaw. Cleaning the saved_state
allows us to avoid some unnecessary branches in ttwu_state_match.

Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20231120-freezer-state-multiple-thaws-v1-2-f2e1dd7ce5a2@quicinc.com

Bug: 292064955
Bug: 312992017
(cherry picked from commit 418146e39891ef1fb2284dee4cabbfe616cd21cf
 https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core)
Change-Id: I245593122edecb1dc9c354c36b59da057d4f4e00
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
This commit is contained in:
Elliot Berman 2023-11-20 09:36:32 -08:00 committed by William McVicker
parent 2a5c5d7c47
commit eba89bbb6f

View File

@ -191,6 +191,7 @@ static int __restore_freezer_state(struct task_struct *p, void *arg)
if (state != TASK_RUNNING) {
WRITE_ONCE(p->__state, state);
p->saved_state = TASK_RUNNING;
return 1;
}