Re: [PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations

From: Peter Zijlstra
Date: Fri Feb 16 2018 - 08:47:14 EST


On Thu, Feb 15, 2018 at 04:20:48PM +0000, Morten Rasmussen wrote:
> +static void update_asym_cpucapacity(int cpu)
> +{
> + if (!static_branch_unlikely(&sched_asym_cpucapacity) &&
> + lowest_flag_domain(cpu, SD_ASYM_CPUCAPACITY))
> + static_branch_enable(&sched_asym_cpucapacity);
> +}

That looks odd, why not just:

if (lowest_flag_domain(cpu, SD_ASYM_CPUCAPACITY))
static_branch_enable(&sched_asym_cpucapacity);

? possibly with:

else
static_branch_disable(&sched_asym_cpucapacity);

if you want to play funny games :-)