p->scx.ops_state should be updated using the release semantics, atomic_long_set_release(), because it is read using atomic_long_read_acquire() at ops_dequeue() and wait_ops_state(). --- kernel/sched/ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c index 53ee906aa2b6..3a40ca2007b6 100644 --- a/kernel/sched/ext.c +++ b/kernel/sched/ext.c @@ -881,7 +881,7 @@ static void do_enqueue_task(struct rq *rq, struct task_struct *p, u64 enq_flags, qseq = rq->scx.ops_qseq++ << SCX_OPSS_QSEQ_SHIFT; WARN_ON_ONCE(atomic_long_read(&p->scx.ops_state) != SCX_OPSS_NONE); - atomic_long_set(&p->scx.ops_state, SCX_OPSS_QUEUEING | qseq); + atomic_long_set_release(&p->scx.ops_state, SCX_OPSS_QUEUEING | qseq); ddsp_taskp = this_cpu_ptr(&direct_dispatch_task); WARN_ON_ONCE(*ddsp_taskp); -- 2.43.0