]> 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>
Thu, 9 Feb 2023 13:01:55 +0000 (13:01 +0000)
commit2a2228f4ba2d4bf1e4a0300b84dfdb5c71661391
tree9782307ec56aee895dce5fe98c350d0658b0a046
parent9b1378cb00cdf837226e7537a0bad270ff6c1b77
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 this could be optimised by inventing a 1:many algorithm for
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.

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