summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorfangqiurong <fangqiurong@kylinos.cn>2026-09-17 15:52:41 +0800
committerTejun Heo <tj@kernel.org>2026-09-17 07:20:04 -1000
commitcb86607ada73185f321baa7f9d94a08a3a40bbf5 (patch)
tree47f6d3585440519a135c869f9f3279bd39df2212 /tools
parentdf5cdc2c832ca4e8a6d774596b9005558761a403 (diff)
downloadlinux-stable-cb86607ada73185f321baa7f9d94a08a3a40bbf5.tar.gz
linux-stable-cb86607ada73185f321baa7f9d94a08a3a40bbf5.zip
sched_ext: Don't run ops.dequeue() with a DSQ lock held
ops.dequeue() is invoked with the source user DSQ's lock still held on the consume and move paths (scx_consume_dispatch_q(), move_task_between_dsqs()). A BPF scheduler which locks the source user DSQ from ops.dequeue() - e.g. by iterating it with bpf_iter_scx_dsq - self-deadlocks. ops.dequeue() can only call the "any" kfuncs and none of them can lock a builtin DSQ, so the global and bypass paths can't deadlock; however, all DSQ locks share one lockdep class, so iterating any user DSQ from ops.dequeue() on those paths trips the recursion check. Move the invocation after the DSQ unlock on all three paths. SCX_TASK_IN_CUSTODY is cleared under the lock serializing the transfer so that the callback is invoked exactly once. Fixes: ebf1ccff79c4 ("sched_ext: Fix ops.dequeue() semantics") Cc: stable@vger.kernel.org # v7.1+ Acked-by: Andrea Righi <arighi@nvidia.com> Signed-off-by: fangqiurong <fangqiurong@kylinos.cn> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions