Re: [PATCH v2] sched/fair: Reschedule the cfs_rq when current is ineligible

From: Chen Yu
Date: Fri Jun 14 2024 - 00:14:45 EST


Hi Prateek,

On 2024-06-14 at 08:46:54 +0530, K Prateek Nayak wrote:
> Hello Chenyu,
>
> > > +static bool check_curr_preempt(struct cfs_rq *cfs_rq, struct
> > > sched_entity *curr)
> > > +{
> > > +    if (sched_feat(RUN_TO_PARITY) || cfs_rq->nr_running <= 1 ||
> > > +        !entity_eligible(cfs_rq, curr))
> >
> > Shouldn't this return false if "entity_eligible(cfs_rq, curr)" returns
> > true since curr is still vruntime eligible on cfs_rq?
> >
> > Would it better to have check_curr_preempt() as follows:
> >
> >     if (sched_feat(RUN_TO_PARITY) || cfs_rq->nr_running <= 1)
> >         return false;
> >
> >     return entity_eligible(cfs_rq, curr);
>
> The above return should have been:
>
> return !entity_eligible(cfs_rq, curr);
>
> Which returns true once curr is not vruntime eligible on cfs_rq.
> Sorry for the oversight.
>

Yes, you are right, thanks for catching this.

thanks,
Chenyu