Re: [RFC v2 1/2] sched/fair: filter out overloaded cpus in SIS

From: Josh Don
Date: Fri Apr 15 2022 - 19:21:46 EST


> > Does this check help that much? Given that you added the filter below
> > to cut out searching overloaded cpus, I would think that the below is
> > sufficient.
>
> I see a ~10% performance drop in the higher load part of the hackbench
> and tbench without this check, in which cases system is quite overloaded
> and idle cpus can hardly exist.
>
> >
> > Another use case that would break with the above:
> >
> > A few cpus are reserved for a job, so that it always has a couple cpus
> > dedicated to it. It can run across the entire machine though (no
> > affinity restriction). If the rest of the machine is very busy, we'd
> > still want to be able to search for and find the idle reserved cpus
> > for the job.
>
> Yes, this could be true if very few cpus are reserved for the job. Along
> with the previous affinity case, I think the following might help both:
>
> static inline bool
> sched_domain_overloaded(struct sched_domain *sd, int nr_overloaded)
> {
> return nr_overloaded == sd->span_weight;
> }
>
> Besides, I think sched_idle_balance() will work well on this case.

The change to sched_domain_overloaded SGTM. But note that an async
load balancing operation such as sched_idle_balance() can't be relied
on for keeping wakeup latency low if we fail to find an idle cpu to
wake on (and one exists).