0

I'm using a server with Xeon 2620 v4, 8 cores.

I need to do a performance benchmark that uses 4 cores. I want the benchmark to be as stable as possible, so I turn off idle state and let everything run at max clock.

However, the max all-core boost of this CPU is 2.3GHz, while the single core is 3GHz. I don't know what's the max frequency when 4 cores are boosted.

Is there anyway to make 4 cores have high boost, the other (may) be idles? I wish to run the benchmark on 4 high-clock core only.

1 Answer 1

0

Use turbostat (linux-tools-common package, I think) to determine what your maximum frequency will be for 4 active cores. In the non-quiet mode it spews a bunch of stuff during startup. Example (4 core processor):

doug@s15:~$ sudo turbostat
turbostat version 20.03.20 - Len Brown <[email protected]>
...
cpu1: MSR_TURBO_RATIO_LIMIT: 0x23242526
35 * 100.0 = 3500.0 MHz max turbo 4 active cores
36 * 100.0 = 3600.0 MHz max turbo 3 active cores
37 * 100.0 = 3700.0 MHz max turbo 2 active cores
38 * 100.0 = 3800.0 MHz max turbo 1 active cores
...

Example (6 core processor - where I have them all set the same):

$ sudo turbostat
turbostat version 20.03.20 - Len Brown <[email protected]>
...
cpu2: MSR_TURBO_RATIO_LIMIT: 0x2b2b2e2e2e2e2e2e
43 * 100.0 = 4300.0 MHz max turbo 8 active cores  <<< I don't actually have 8 cores
43 * 100.0 = 4300.0 MHz max turbo 7 active cores  <<< I don't actually have 7 cores
46 * 100.0 = 4600.0 MHz max turbo 6 active cores
46 * 100.0 = 4600.0 MHz max turbo 5 active cores
46 * 100.0 = 4600.0 MHz max turbo 4 active cores
46 * 100.0 = 4600.0 MHz max turbo 3 active cores
46 * 100.0 = 4600.0 MHz max turbo 2 active cores
46 * 100.0 = 4600.0 MHz max turbo 1 active cores

My processors are unlocked, and therefore this stuff can be changed. I don't know about yours. I would not recommend it anyhow, without extreme attention to thermal and power management.

For your test, use taskset to force the job onto 4 cores, and let the others go into deep idle. For my example, I'll use 2 of 4 cores and need to know the CPU to core mapping: Core 0 has CPUs 0 and 4; Core 1 has CPUs 1 and 5; Core 2 has CPUs 2 and 6; Core 3 has CPUs 3 and 7.

So (the program is mine, but will spin out 4 threads at near 100% load per thread):

$ taskset -c 2,3,6,7 ./waiter 4 960 4 1000000000 0 1

And watching with turbostat:

doug@s15:~$ sudo turbostat --quiet --show Core,CPU,Busy%,Bzy_MHz,PkgTmp,PkgWatt,IRQ --interval 6
Core    CPU     Busy%   Bzy_MHz IRQ     PkgTmp  PkgWatt
-       -       0.15    1603    2257    30      3.78
0       0       0.14    1605    264     30      3.78
0       4       0.67    1601    1362
1       1       0.03    1604    56
1       5       0.04    1604    81
2       2       0.14    1604    188    <<<< The system is still idle
2       6       0.03    1603    73
3       3       0.05    1605    83
3       7       0.09    1615    150
Core    CPU     Busy%   Bzy_MHz IRQ     PkgTmp  PkgWatt
-       -       0.15    1602    2372    26      3.79
0       0       0.53    1601    1073    26      3.79
0       4       0.27    1600    538
1       1       0.07    1604    128
1       5       0.09    1603    173
2       2       0.13    1603    180
2       6       0.02    1602    50
3       3       0.04    1604    83
3       7       0.08    1602    147
Core    CPU     Busy%   Bzy_MHz IRQ     PkgTmp  PkgWatt
-       -       37.45   3692    31573   46      26.22
0       0       0.97    3236    3991    46      26.22
0       4       0.15    3285    622
1       1       0.06    2829    189
1       5       0.09    2402    177
2       2       74.62   3693    6727    <<<< The load was added during this sample
2       6       74.54   3696    6690
3       3       74.61   3694    6608
3       7       74.60   3694    6569
Core    CPU     Busy%   Bzy_MHz IRQ     PkgTmp  PkgWatt
-       -       49.46   3696    40399   48      33.60
0       0       1.15    3599    4866    48      33.60
0       4       0.03    3546    139
1       1       0.06    3560    230
1       5       0.04    3562    191
2       2       98.60   3696    8860    <<<< Now steady state with load
2       6       98.60   3696    8821
3       3       98.60   3696    8678
3       7       98.60   3696    8614
Core    CPU     Busy%   Bzy_MHz IRQ     PkgTmp  PkgWatt
-       -       49.46   3694    40381   50      33.72
0       0       1.12    3599    4821    50      33.72
0       4       0.03    3543    170
1       1       0.06    3568    250
1       5       0.05    3564    232
2       2       98.61   3695    8811
2       6       98.61   3695    8813
3       3       98.61   3695    8680
3       7       98.61   3695    8604
Core    CPU     Busy%   Bzy_MHz IRQ     PkgTmp  PkgWatt
-       -       49.46   3695    40356   50      33.83
0       0       1.11    3599    4787    50      33.83
0       4       0.05    3547    243
1       1       0.05    3546    192
1       5       0.05    3543    223
2       2       98.60   3696    8810
2       6       98.60   3696    8813
3       3       98.60   3696    8680
3       7       98.60   3696    8608
Core    CPU     Busy%   Bzy_MHz IRQ     PkgTmp  PkgWatt
-       -       49.39   3695    41291   51      33.92
0       0       0.96    3598    4736    51      33.92
0       4       0.05    3522    199
1       1       0.27    3582    1131
1       5       0.06    3540    259
2       2       98.44   3695    8815
2       6       98.44   3695    8819
3       3       98.43   3695    8703
3       7       98.44   3695    8629

Observe the CPU frequency is close to the 2 cores limit, and stable. Note that I didn't do anything special with idle states.

2
  • Which command should I use to force others CPU to deep idle? Or should I just ignore them?
    – Duke Le
    Commented Sep 8, 2020 at 16:15
  • Just ignore them. The unused CPUs should go into deep idle automatically. My point is that you shouldn't need to disable idle states for this test. If it comes to it, you could take unused CPUs offline. Observe that there is minor activity on my unused CPUs. Commented Sep 8, 2020 at 16:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .