Re: [PATCH 1/2] sched_ext: Enable tick for finite slices on nohz_full

Tejun Heo <[email protected]>
Newsgroups dev.linux.lists.sched-ext,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.