Re: [PATCH v5 1/9] sched: Extend scheduler's asym packing

From: Nilay Vaish
Date: Sat Oct 01 2016 - 12:38:59 EST


On 1 October 2016 at 06:45, Srinivas Pandruvada
<srinivas.pandruvada@xxxxxxxxxxxxxxx> wrote:
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index e86c4a5..08135ca 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -6237,7 +6237,25 @@ static void init_sched_groups_capacity(int cpu, struct sched_domain *sd)
> WARN_ON(!sg);
>
> do {
> + int cpu, max_cpu = -1, prev_cpu = -1;
> +
> sg->group_weight = cpumask_weight(sched_group_cpus(sg));
> +
> + if (!(sd->flags & SD_ASYM_PACKING))
> + goto next;
> +
> + for_each_cpu(cpu, sched_group_cpus(sg)) {
> + if (prev_cpu < 0) {
> + prev_cpu = cpu;
> + max_cpu = cpu;

It seems that you can drop prev_cpu and put the check on max_cpu instead.

--
Nilay