]> 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>
Sat, 4 Feb 2023 15:33:35 +0000 (15:33 +0000)
commit9d2b4340c218c76e62dad29e1c91c7a6cc381c6e
treecc04e54397f77b36b05a9f86a1b3808e3dc52ad6
parentce7e2d1e046a163f4c44f091c8a7cc52c49c91ff
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