]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sparc64: Improve boot time by per cpu map update
authorAtish Patra <atish.patra@oracle.com>
Mon, 13 Feb 2017 02:32:58 +0000 (19:32 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 6 Apr 2017 07:13:55 +0000 (00:13 -0700)
commit5f67cbb420a412dac3e06ef48584b20de67032b1
treeae9b88f992358e8dde4205c9645a6d47691f7f0e
parent98bef0084952b8cbabed2a8e8913c331938e927f
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>
arch/sparc/kernel/smp_64.c