Re: [PATCH v2] sched/deadline: Make dl-server nohz full aware
From: Juri Lelli
Date: Thu Oct 01 2026 - 11:53:52 EST
On 01/10/26 16:33, Peter Zijlstra wrote:
> On Thu, Oct 01, 2026 at 04:27:36PM +0200, Peter Zijlstra wrote:
>
> > > bool sched_can_stop_tick(struct rq *rq)
> > > {
> > > /* Deadline tasks, even if single, need the tick */
> > > if (rq->dl.dl_nr_running)
> > > return false;
> > >
> > > /*
> > > + * If there are RT tasks, we may need the tick (for >1 RR tasks),
> > > + * but we must also service lower-priority CFS/SCX tasks via dl-servers.
> > > */
> > > + if (rq->rt.rt_nr_running) {
> > > + bool cfs_or_scx_queued = false;
> > > +
> > > + if (rq->cfs.h_nr_queued) {
> > > + dl_server_start(&rq->fair_server);
> > > + cfs_or_scx_queued = true;
> > > + }
> > > +#ifdef CONFIG_SCHED_CLASS_EXT
> > > + if (rq->scx.nr_running) {
> > > + dl_server_start(&rq->ext_server);
> > > + cfs_or_scx_queued = true;
> > > + }
> > > +#endif
> > > + if (cfs_or_scx_queued)
> > > return false;
>
> What the purpose of this boolean, both true assignments above can simply
> be return false, no?
But we won't start the ext_server, even if EXT tasks are present, if we
return false in case CFS tasks are present.
>
> > >
> > > + /*
> > > + * Only RT tasks, no CFS/SCX. Stop servers to prevent spurious
>
> No DL either, you've filtered those out above.
Right.
>
> > > + * wakeups. Tick can stop for single RR or any FIFO, but must
> > > + * run for multiple RR (round-robin behavior).
> > > + */
> > > + dl_servers_stop_all(rq);
> > > + if (rq->rt.rr_nr_running > 1)
> > > + return false;
> > > return true;
> > > + }
>