]> www.infradead.org Git - users/dwmw2/linux.git/commit
x86/tsc: Avoid synchronizing TSCs with multiple CPUs in parallel
authorDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 16 Feb 2021 15:05:11 +0000 (15:05 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 1 Feb 2022 12:38:55 +0000 (12:38 +0000)
commit129436598eefd91cb281af7405466d660be64b50
tree49ac821b65f61ece97a130418e11a5e587d3f558
parent78b9b88d716464b8685120a2d006619744564cb4
x86/tsc: Avoid synchronizing TSCs with multiple CPUs in parallel

The TSC sync algorithm is only designed to do a 1:1 sync between the
source and target CPUs.

In order to enable parallel CPU bringup, serialize it by using an
atomic_t containing the number of the target CPU whose turn it is.

In future we should look at inventing a 1:many TSC synchronization
algorithm, perhaps falling back to 1:1 if a warp is observed but
doing them all in parallel for the common case where no adjustment
is needed. Or just avoiding the sync completely for cases like kexec
where we trust that they were in sync already.

This is perfectly sufficient for the short term though, until we get
those further optimisations.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
arch/x86/kernel/tsc_sync.c