diff mbox series

[v6,11/11] x86/smpboot: reuse timer calibration

Message ID 20230202215625.3248306-12-usama.arif@bytedance.com (mailing list archive)
State New, archived
Headers show
Series Parallel CPU bringup for x86_64 | expand

Commit Message

Usama Arif Feb. 2, 2023, 9:56 p.m. UTC
From: Arjan van de Ven <arjan@linux.intel.com>

No point recalibrating for known-constant tsc.
When tested on a 128 core, 2 socket server, this reduces
the parallel smpboot time from 100ms to 30ms.

Not-signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Usama Arif <usama.arif@bytedance.com>
---
 arch/x86/kernel/tsc.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Thomas Gleixner Feb. 7, 2023, 12:31 a.m. UTC | #1
On Thu, Feb 02 2023 at 21:56, Usama Arif wrote:
> From: Arjan van de Ven <arjan@linux.intel.com>
>
> No point recalibrating for known-constant tsc.
> When tested on a 128 core, 2 socket server, this reduces
> the parallel smpboot time from 100ms to 30ms.

This is completely independent of the parallel bringup, so this should
have a proper SOB and be at the beginning of this series for a long
time.

> Not-signed-off-by: Arjan van de Ven <arjan@linux.intel.com>

Thanks,

        tglx
Arjan van de Ven Feb. 7, 2023, 11:16 p.m. UTC | #2
On 2/2/2023 1:56 PM, Usama Arif wrote:
> From: Arjan van de Ven <arjan@linux.intel.com>
> 
> No point recalibrating for known-constant tsc.
> When tested on a 128 core, 2 socket server, this reduces
> the parallel smpboot time from 100ms to 30ms.
> 
> Not-signed-off-by: Arjan van de Ven <arjan@linux.intel.com>

you can turn this in a Signed-off-By:
Thomas Gleixner Feb. 7, 2023, 11:55 p.m. UTC | #3
Arjan!

On Tue, Feb 07 2023 at 15:16, Arjan van de Ven wrote:
> On 2/2/2023 1:56 PM, Usama Arif wrote:
>> From: Arjan van de Ven <arjan@linux.intel.com>
>> 
>> No point recalibrating for known-constant tsc.
>> When tested on a 128 core, 2 socket server, this reduces
>> the parallel smpboot time from 100ms to 30ms.
>> 
>> Not-signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
>
> you can turn this in a Signed-off-By:

Please post your patch separately as it is a completely orthogonal issue
and can be reviewed and discussed independently of the parallel bringup
effort.

Thanks,

        tglx
diff mbox series

Patch

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index a78e73da4a74..bab8a98080cf 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -1569,6 +1569,9 @@  unsigned long calibrate_delay_is_known(void)
 	if (!constant_tsc || !mask)
 		return 0;
 
+	if (cpu != 0)
+		return cpu_data(0).loops_per_jiffy;
+
 	sibling = cpumask_any_but(mask, cpu);
 	if (sibling < nr_cpu_ids)
 		return cpu_data(sibling).loops_per_jiffy;