Skip to content

Commit ff3b373

Browse files
committed
Merge tag 'sched_urgent_for_v6.14_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fix from Borislav Petkov: - Clarify what happens when a task is woken up from the wake queue and make clear its removal from that queue is atomic * tag 'sched_urgent_for_v6.14_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched: Clarify wake_up_q()'s write to task->wake_q.next
2 parents 592c358 + bcc6244 commit ff3b373

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kernel/sched/core.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,9 +1063,10 @@ void wake_up_q(struct wake_q_head *head)
10631063
struct task_struct *task;
10641064

10651065
task = container_of(node, struct task_struct, wake_q);
1066-
/* Task can safely be re-inserted now: */
10671066
node = node->next;
1068-
task->wake_q.next = NULL;
1067+
/* pairs with cmpxchg_relaxed() in __wake_q_add() */
1068+
WRITE_ONCE(task->wake_q.next, NULL);
1069+
/* Task can safely be re-inserted now. */
10691070

10701071
/*
10711072
* wake_up_process() executes a full barrier, which pairs with

0 commit comments

Comments
 (0)