Commit 5a01bb8e authored by Sudeep Holla's avatar Sudeep Holla
Browse files

arch_topology: Avoid parsing through all the CPUs once a outlier CPU is found

There is no point in looping through all the CPU's physical package
identifier to check if it is valid or not once a CPU which is outside
the topology(i.e. outlier CPU) is found.

Let us just break out of the loop early in such case.

Link: https://lore.kernel.org/r/20220704101605.1318280-16-sudeep.holla@arm.com


Tested-by: default avatarIonela Voinescu <ionela.voinescu@arm.com>
Tested-by: default avatarConor Dooley <conor.dooley@microchip.com>
Reviewed-by: default avatarGavin Shan <gshan@redhat.com>
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent 9eb5e54f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -642,8 +642,10 @@ static int __init parse_dt_topology(void)
	 * only mark cores described in the DT as possible.
	 */
	for_each_possible_cpu(cpu)
		if (cpu_topology[cpu].package_id < 0)
		if (cpu_topology[cpu].package_id < 0) {
			ret = -EINVAL;
			break;
		}

out_map:
	of_node_put(map);