Re: [PATCH 1/2] sched_ext: Reimplement scx_bpf_reenqueue_local()
From: David Vernet
Date: Tue Jul 09 2024 - 17:18:58 EST
On Tue, Jul 09, 2024 at 11:09:42AM -1000, Tejun Heo wrote:
> scx_bpf_reenqueue_local() is used to re-enqueue tasks on the local DSQ from
> ops.cpu_release(). Because the BPF scheduler may dispatch tasks to the same
> local DSQ, to avoid processing the same tasks repeatedly, it first takes the
> number of queued tasks and processes the task at the head of the queue that
> number of times.
>
> This is incorrect as a task can be dispatched to the same local DSQ with
> SCX_ENQ_HEAD. Such a task will be processed repeatedly until the count is
> exhausted and the succeeding tasks won't be processed at all.
>
> Fix it by first moving all candidate tasks to a private list and then
> processing that list. While at it, remove the WARNs. They're rather
> superflous as later steps will check them anyway.
>
> Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
> Fixes: 245254f7081d ("sched_ext: Implement sched_ext_ops.cpu_acquire/release()")
> Cc: David Vernet <void@xxxxxxxxxxxxx>
Acked-by: David Vernet <void@xxxxxxxxxxxxx>
Attachment:
signature.asc
Description: PGP signature