sparc64: Improve boot time by per cpu map update
Currently, smp_fill_in_sib_core_maps is invoked during cpu_up to setup
all the core/sibling map correctly. This happens in the order of O(n^2)
as it iterates over all the online cpus twice when each cpu comes online.
This increases smp_init() execution time exponentially leading to a
higher boot time.
Optimize the code path by comparing only the current cpu with online
cpus and set the maps for both the cpus simultaneously. Take this
opportunity to merge all three for loops into one as well. Here is
the smp_init() time after and before the fix.
Number of cpus: before fix: after the fix:
512 2.30s .283s
1024 14.23s .493s
Orabug:
25496463
Signed-off-by: Atish Patra <atish.patra@oracle.com>
Reviewed-by: Pavel Tatashin <pasha.tatashin@oracle.com>
Reviewed-by: Allen Pais <allen.pais@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>