Re: [PATCH] sched_ext: introduce cpu tick

From: 'Tejun Heo'
Date: Tue Jun 10 2025 - 14:00:04 EST


Hello,

On Tue, Jun 10, 2025 at 08:59:45AM +0000, liuwenfang wrote:
> Assume one CPU is running one RT task and one runnable scx task on
> its local dsq, the scx task cannot be scheduled until RT task enters
> sleep, if RT task will run for 100ms, the scx task should be migrated
> to other dsqs, then it can have a chance to be scheduled by other CPUs.
>
> So cpu_tick is added to notitfy BPF scheduler to check long runnable
> scx on its local dsq, related policy can be taken to improve the
> performance.

(cc'ing Kumar as we discussed similar issue recently)

There are some race conditions we need to address but calling
scx_bpf_reenqueue_local() from ops.cpu_release() is the intended way of
handling these situations. I don't think periodically polling from ticks is
a good approach, especially given that ticks can be skipped w/ nohz_full.

Thanks.

--
tejun