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
This commit is contained in:
Linus Torvalds
2025-02-16 10:38:24 -08:00

View File

@@ -1063,9 +1063,10 @@ void wake_up_q(struct wake_q_head *head)
struct task_struct *task;
task = container_of(node, struct task_struct, wake_q);
/* Task can safely be re-inserted now: */
node = node->next;
task->wake_q.next = NULL;
/* pairs with cmpxchg_relaxed() in __wake_q_add() */
WRITE_ONCE(task->wake_q.next, NULL);
/* Task can safely be re-inserted now. */
/*
* wake_up_process() executes a full barrier, which pairs with