Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit c72d3a46 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched/rt: Fix an incorrect initialization bug in CPU selection



When SCHED_CORE_ROTATE config is not enabled, the CPU search
should be done in the numerical order. For this to happen,
cpumask_next(cpu, cpumask) should be called with -1 for the
first time in the loop. The current code does not initialize
cpu to -1 when SCHED_CORE_ROTATE is not enabled. This can
potentially result in skipping the CPU search completely. Fix
this issue by defining find_first_cpu_bit to -1 when
SCHED_CORE_ROTATE is not enabled.

	cpu = find_first_cpu_bit(task, &search_cpu, sg_target,
				 &avoid_prev_cpu, &do_rotate,
				 &first_cpu_bit_env);

...

retry:
	while ((cpu = cpumask_next(cpu, &search_cpu)) < nr_cpu_ids) {
		cpumask_clear_cpu(cpu, &search_cpu);
		...
	}

Also, while at it fix a similar bug where we could potentially skip
the backup CPU search irrespective of SCHED_CORE_ROTATE config status.

Change-Id: I69599f6687269e9970a6d483d0605efc1d725a0c
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 04570ccd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment