Skip to content

Commit 708024b

Browse files
author
Peter Zijlstra
committed
sched: Be more strict about p->is_blocked
Upon entry to try_to_block_task(), p->is_blocked should be false. After all, the prior wakeup would have made it so per ttwu_do_wakeup(). Ensure this is the case, rather than clearing it in the path that doesn't set it. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: John Stultz <jstultz@google.com> Link: https://patch.msgid.link/20260526113322.364017314%40infradead.org
1 parent abc40cc commit 708024b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

kernel/sched/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6676,8 +6676,9 @@ static bool try_to_block_task(struct rq *rq, struct task_struct *p,
66766676
{
66776677
unsigned long task_state = *task_state_p;
66786678

6679+
WARN_ON_ONCE(p->is_blocked);
6680+
66796681
if (signal_pending_state(task_state, p)) {
6680-
p->is_blocked = 0;
66816682
WRITE_ONCE(p->__state, TASK_RUNNING);
66826683
*task_state_p = TASK_RUNNING;
66836684
clear_task_blocked_on(p, NULL);

0 commit comments

Comments
 (0)