Re: [PATCH v4 1/7] sched/fair: default to false in test_idle_cores

From: Josh Don
Date: Mon Jun 27 2022 - 18:54:11 EST


On Sun, Jun 19, 2022 at 5:05 AM Abel Wu <wuyun.abel@xxxxxxxxxxxxx> wrote:
>
> It's uncertain whether idle cores exist or not if shared sched-domains
> are not ready, so returning "no idle cores" usually makes sense.
>
> While __update_idle_core() is an exception, it checks status of this
> core and set to shared sched-domain if necessary. So the whole logic
> depends on the existence of shared domain, and can bail out early if
> it isn't available. Modern compilers seems capable of handling such
> cases, so remove the tricky self-defined default return value.

I don't think the compiler will be able to bail out of the smt
iteration early, since it'll have to do another rcu dereference for
the sd_llc in set(). But I also don't think this case needs
optimization, since it should be transient while the domain isn't
ready.

Reviewed-by: Josh Don <joshdon@xxxxxxxxxx>