Re: [PATCH 1/2] sched_ext: Enable tick for finite slices on nohz_full
From: Tejun Heo
Date: Tue Jul 07 2026 - 16:56:16 EST
Hello, Andrea.
On Tue, Jul 07, 2026 at 10:17:59AM +0200, Andrea Righi wrote:
> if ((p->scx.slice == SCX_SLICE_INF) !=
> (bool)(rq->scx.flags & SCX_RQ_CAN_STOP_TICK)) {
> if (p->scx.slice == SCX_SLICE_INF) {
The slice type is tested three times here (the XOR, the inner if, and the
finite tail). Can you split on it once instead?
if (p->scx.slice == SCX_SLICE_INF) {
if (!(rq->scx.flags & SCX_RQ_CAN_STOP_TICK)) {
rq->scx.flags |= SCX_RQ_CAN_STOP_TICK;
sched_update_tick_dependency(rq);
update_other_load_avgs(rq);
}
} else {
if (rq->scx.flags & SCX_RQ_CAN_STOP_TICK) {
rq->scx.flags &= ~SCX_RQ_CAN_STOP_TICK;
update_other_load_avgs(rq);
}
if (tick_nohz_full_cpu(cpu_of(rq)))
tick_nohz_dep_set_cpu(cpu_of(rq), TICK_DEP_BIT_SCHED);
}
update_other_load_avgs() lands in both arms, but the infinite/finite split
reads more directly than keying off the transition.
Thanks.
--
tejun