linux/kernel/sched
Tejun Heo 7de9a6fb44 sched_ext: Wait for SCX_OPSS_DISPATCHING before reenqueueing a task
ebf1ccff79 ("sched_ext: Fix ops.dequeue() semantics") moved the final
ops_state store in scx_dispatch_enqueue() after the DSQ unlock so that the
custody update and ops.dequeue() precede it. A task can thus be found on a
DSQ while still SCX_OPSS_DISPATCHING.

The dequeue and core-sched pick paths wait for the state to clear in
ops_dequeue() but the reenqueue paths don't. A reenqueue in that window runs
ops.enqueue() and sets SCX_OPSS_QUEUED before the dispatch has completed.
The dispatcher's final store then overwrites it with SCX_OPSS_NONE and
finish_dispatch() drops every later dispatch of the task.

Wait for SCX_OPSS_DISPATCHING to clear before dequeueing a task for
reenqueue, the same way ops_dequeue() does.

Fixes: ebf1ccff79 ("sched_ext: Fix ops.dequeue() semantics")
Cc: stable@vger.kernel.org # v7.1+
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
2026-09-15 12:34:44 -10:00
..
ext sched_ext: Wait for SCX_OPSS_DISPATCHING before reenqueueing a task 2026-09-15 12:34:44 -10:00
autogroup.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
autogroup.h
build_policy.c sched_ext: Move scx_dispatch_sched() to a new inlines.h 2026-07-15 13:37:59 -10:00
build_utility.c
clock.c sched/clock: Avoid false sharing for sched_clock_irqtime 2026-02-03 12:04:19 +01:00
completion.c
core_sched.c sched: Unify SMT active check via sched_smt_active() 2026-05-19 12:17:37 +02:00
core.c Merge branch 'for-7.3' into for-7.3-arena-args 2026-08-12 09:55:20 -10:00
cpuacct.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cpudeadline.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cpudeadline.h
cpufreq_schedutil.c cpufreq: schedutil: Publish util hooks only after all sg_cpu are initialized 2026-07-22 15:20:39 +02:00
cpufreq.c
cpupri.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cpupri.h
cputime.c Merge branch 'idle-time-acc' into features 2026-06-16 16:21:46 +02:00
deadline.c sched/deadline: Use revised wakeup rule only for running dl_server 2026-07-30 12:59:23 +02:00
debug.c sched/fair: Remove task_group->se pointer array 2026-06-02 12:26:11 +02:00
fair.c sched/fair: Fix newidle vs core-sched 2026-06-11 13:41:23 +02:00
features.h sched/rt: Have RT_PUSH_IPI be default off for non PREEMPT_RT 2026-05-19 12:17:39 +02:00
idle.c sched_ext: Route ops.update_idle() to sub-schedulers and re-notify owed scheds 2026-07-13 22:18:44 -10:00
isolation.c cgroup/cpuset: Call housekeeping_update() without holding cpus_read_lock 2026-02-23 10:46:49 -10:00
loadavg.c
Makefile sched: Enable context analysis for core.c and fair.c 2026-01-05 16:43:36 +01:00
membarrier.c Locking updates for v7.2: 2026-06-15 14:21:14 +05:30
pelt.c treewide: Update email address 2026-01-11 06:09:11 -10:00
pelt.h
psi.c sched/psi: Shut down rtpoll_timer in psi_cgroup_free() 2026-07-15 05:00:57 -10:00
rq-offsets.c
rt.c sched: Rework prev_balance() to avoid stale prev references 2026-06-02 12:26:06 +02:00
sched-pelt.h
sched.h sched_ext: Rename balance-era identifiers to dispatch terms 2026-08-15 00:07:42 -10:00
smp.h
stats.c
stats.h sched/fair: Co-locate cfs_rq and sched_entity in cfs_tg_state 2026-06-02 12:26:10 +02:00
stop_task.c sched: Rework prev_balance() to avoid stale prev references 2026-06-02 12:26:06 +02:00
swait.c
syscalls.c Linux 7.0-rc4 2026-03-17 07:14:42 +01:00
topology.c sched/topology: Provide arch_llc_mask for cache aware scheduling 2026-05-29 12:43:15 +02:00
wait_bit.c
wait.c