summaryrefslogtreecommitdiff
path: root/include/linux/memory
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2026-04-25 03:31:35 +0300
committerTejun Heo <tj@kernel.org>2026-04-25 03:31:35 +0300
commit2f2ea77092660b53bfcbc4acc590b57ce9ab5dce (patch)
tree78a52bc8f01ee978a3ef70997f763815b3836c0d /include/linux/memory
parentcc2a387d330d1fc51a9b7f211a7e5d39c9f0ab94 (diff)
downloadlinux-2f2ea77092660b53bfcbc4acc590b57ce9ab5dce.tar.xz
sched_ext: Use dsq->first_task instead of list_empty() in dispatch_enqueue() FIFO-tail
dispatch_enqueue()'s FIFO-tail path used list_empty(&dsq->list) to decide whether to set dsq->first_task on enqueue. dsq->list can contain parked BPF iterator cursors (SCX_DSQ_LNODE_ITER_CURSOR), so list_empty() is not a reliable "no real task" check. If the last real task is unlinked while a cursor is parked, first_task becomes NULL; the next FIFO-tail enqueue then sees list_empty() == false and skips the first_task update, leaving scx_bpf_dsq_peek() returning NULL for a non-empty DSQ. Test dsq->first_task directly, which already tracks only real tasks and is maintained under dsq->lock. Fixes: 44f5c8ec5b9a ("sched_ext: Add lockless peek operation for DSQs") Cc: stable@vger.kernel.org # v6.19+ Reported-by: Chris Mason <clm@meta.com> Signed-off-by: Tejun Heo <tj@kernel.org> Reviewed-by: Andrea Righi <arighi@nvidia.com> Cc: Ryan Newton <newton@meta.com>
Diffstat (limited to 'include/linux/memory')
0 files changed, 0 insertions, 0 deletions