diff mbox series

[2/2] freezer,sched: clean saved_state when restoring it during thaw

Message ID 20231120-freezer-state-multiple-thaws-v1-2-a4c453f50745@quicinc.com (mailing list archive)
State Superseded
Headers show
Series freezer,sched: do not restore saved_state of a thawed task | expand

Commit Message

Elliot Berman Nov. 20, 2023, 5:34 p.m. UTC
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>
---
 kernel/freezer.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/kernel/freezer.c b/kernel/freezer.c
index 759006a9a910..f57aaf96b829 100644
--- a/kernel/freezer.c
+++ b/kernel/freezer.c
@@ -187,6 +187,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;
 	}