← Documents Documentation/admin-guide/pm/intel-speed-select.rst GitHub 원문 ↗

Linux 6.18.37 · Administration / Power Management

Intel Speed Select Technology User Guide

intel-speed-select로 SST performance profile, core priority, base와 turbo frequency를 구성하고 측정하는 방법을 설명합니다.

Source pathDocumentation/admin-guide/pm/intel-speed-select.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

intel-speed-select.rst:1-939

Intel SST는 CPU를 단순히 빠르게 만드는 기능이 아니라, online CPU 수, core priority, guaranteed base frequency, turbo headroom을 workload에 맞게 재분배하는 네 기능군의 조합입니다.

각 변경 전에는 support·lock·현재 profile과 baseline을 확인하고, 변경 뒤에는 cpufreq와 turbostat로 실제 frequency를 검증해야 합니다. High-priority CPU의 이득은 low-priority CPU clipping이라는 비용과 함께 평가합니다.

기능핵심
Tool`intel-speed-select`; kernel tree의 `tools/power/x86/intel-speed-select/`
SST-PPOnline CPU 집합과 guaranteed base frequency를 profile별로 전환
SST-CPCore별 CLOS priority와 power distribution 설정
SST-BFHigh-priority CPU의 base frequency를 높이고 low-priority CPU를 낮춤
SST-TFPriority별 all-core turbo ratio limit 적용
CLOS최대 4개 group, ordered 또는 proportional priority
OOBSapphire Rapids부터 BMC interface daemon mode 지원
측정`cpufreq`, `stress`, `perf bench sched pipe`, `turbostat`

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ============================================================
4 Intel(R) Speed Select Technology User Guide
5 ============================================================
6
7 The Intel(R) Speed Select Technology (Intel(R) SST) provides a powerful new
8 collection of features that give more granular control over CPU performance.
9 With Intel(R) SST, one server can be configured for power and performance for a
10 variety of diverse workload requirements.
11
12 Refer to the links below for an overview of the technology:
13
14 - https://www.intel.com/content/www/us/en/architecture-and-technology/speed-select-technology-article.html
15 - https://builders.intel.com/docs/networkbuilders/intel-speed-select-technology-base-frequency-enhancing-performance.pdf
16
17 These capabilities are further enhanced in some of the newer generations of
18 server platforms where these features can be enumerated and controlled
19 dynamically without pre-configuring via BIOS setup options. This dynamic
20 configuration is done via mailbox commands to the hardware. One way to enumerate
21 and configure these features is by using the Intel Speed Select utility.
22
23 This document explains how to use the Intel Speed Select tool to enumerate and
24 control Intel(R) SST features. This document gives example commands and explains
25 how these commands change the power and performance profile of the system under
26 test. Using this tool as an example, customers can replicate the messaging
27 implemented in the tool in their production software.
28
29 intel-speed-select configuration tool
30 ======================================
31
32 Most Linux distribution packages may include the "intel-speed-select" tool. If not,
33 it can be built by downloading the Linux kernel tree from kernel.org. Once
34 downloaded, the tool can be built without building the full kernel.
35
36 From the kernel tree, run the following commands::
37
38 # cd tools/power/x86/intel-speed-select/
39 # make
40 # make install
41
42 Getting Help
43 ------------
44
45 To get help with the tool, execute the command below::
46
47 # intel-speed-select --help
48
49 The top-level help describes arguments and features. Notice that there is a
50 multi-level help structure in the tool. For example, to get help for the feature "perf-profile"::
51
52 # intel-speed-select perf-profile --help
53
54 To get help on a command, another level of help is provided. For example for the command info "info"::
55
56 # intel-speed-select perf-profile info --help
57
58 Summary of platform capability
59 ------------------------------
60 To check the current platform and driver capabilities, execute::
61
62 #intel-speed-select --info
63
64 For example on a test system::
65
66 # intel-speed-select --info
67 Intel(R) Speed Select Technology
68 Executing on CPU model: X
69 Platform: API version : 1
70 Platform: Driver version : 1
71 Platform: mbox supported : 1
72 Platform: mmio supported : 1
73 Intel(R) SST-PP (feature perf-profile) is supported
74 TDP level change control is unlocked, max level: 4
75 Intel(R) SST-TF (feature turbo-freq) is supported
76 Intel(R) SST-BF (feature base-freq) is not supported
77 Intel(R) SST-CP (feature core-power) is supported
78
79 Intel(R) Speed Select Technology - Performance Profile (Intel(R) SST-PP)
80 ------------------------------------------------------------------------
81
82 This feature allows configuration of a server dynamically based on workload
83 performance requirements. This helps users during deployment as they do not have
84 to choose a specific server configuration statically. This Intel(R) Speed Select
85 Technology - Performance Profile (Intel(R) SST-PP) feature introduces a mechanism
86 that allows multiple optimized performance profiles per system. Each profile
87 defines a set of CPUs that need to be online and rest offline to sustain a
88 guaranteed base frequency. Once the user issues a command to use a specific
89 performance profile and meet CPU online/offline requirement, the user can expect
90 a change in the base frequency dynamically. This feature is called
91 "perf-profile" when using the Intel Speed Select tool.
92
93 Number or performance levels
94 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
95
96 There can be multiple performance profiles on a system. To get the number of
97 profiles, execute the command below::
98
99 # intel-speed-select perf-profile get-config-levels
100 Intel(R) Speed Select Technology
101 Executing on CPU model: X
102 package-0
103 die-0
104 cpu-0
105 get-config-levels:4
106 package-1
107 die-0
108 cpu-14
109 get-config-levels:4
110
111 On this system under test, there are 4 performance profiles in addition to the
112 base performance profile (which is performance level 0).
113
114 Lock/Unlock status
115 ~~~~~~~~~~~~~~~~~~
116
117 Even if there are multiple performance profiles, it is possible that they
118 are locked. If they are locked, users cannot issue a command to change the
119 performance state. It is possible that there is a BIOS setup to unlock or check
120 with your system vendor.
121
122 To check if the system is locked, execute the following command::
123
124 # intel-speed-select perf-profile get-lock-status
125 Intel(R) Speed Select Technology
126 Executing on CPU model: X
127 package-0
128 die-0
129 cpu-0
130 get-lock-status:0
131 package-1
132 die-0
133 cpu-14
134 get-lock-status:0
135
136 In this case, lock status is 0, which means that the system is unlocked.
137
138 Properties of a performance level
139 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
140
141 To get properties of a specific performance level (For example for the level 0, below), execute the command below::
142
143 # intel-speed-select perf-profile info -l 0
144 Intel(R) Speed Select Technology
145 Executing on CPU model: X
146 package-0
147 die-0
148 cpu-0
149 perf-profile-level-0
150 cpu-count:28
151 enable-cpu-mask:000003ff,f0003fff
152 enable-cpu-list:0,1,2,3,4,5,6,7,8,9,10,11,12,13,28,29,30,31,32,33,34,35,36,37,38,39,40,41
153 thermal-design-power-ratio:26
154 base-frequency(MHz):2600
155 speed-select-turbo-freq:disabled
156 speed-select-base-freq:disabled
157 ...
158 ...
159
160 Here -l option is used to specify a performance level.
161
162 If the option -l is omitted, then this command will print information about all
163 the performance levels. The above command is printing properties of the
164 performance level 0.
165
166 For this performance profile, the list of CPUs displayed by the
167 "enable-cpu-mask/enable-cpu-list" at the max can be "online." When that
168 condition is met, then base frequency of 2600 MHz can be maintained. To
169 understand more, execute "intel-speed-select perf-profile info" for performance
170 level 4::
171
172 # intel-speed-select perf-profile info -l 4
173 Intel(R) Speed Select Technology
174 Executing on CPU model: X
175 package-0
176 die-0
177 cpu-0
178 perf-profile-level-4
179 cpu-count:28
180 enable-cpu-mask:000000fa,f0000faf
181 enable-cpu-list:0,1,2,3,5,7,8,9,10,11,28,29,30,31,33,35,36,37,38,39
182 thermal-design-power-ratio:28
183 base-frequency(MHz):2800
184 speed-select-turbo-freq:disabled
185 speed-select-base-freq:unsupported
186 ...
187 ...
188
189 There are fewer CPUs in the "enable-cpu-mask/enable-cpu-list". Consequently, if
190 the user only keeps these CPUs online and the rest "offline," then the base
191 frequency is increased to 2.8 GHz compared to 2.6 GHz at performance level 0.
192
193 Get current performance level
194 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
195
196 To get the current performance level, execute::
197
198 # intel-speed-select perf-profile get-config-current-level
199 Intel(R) Speed Select Technology
200 Executing on CPU model: X
201 package-0
202 die-0
203 cpu-0
204 get-config-current_level:0
205
206 First verify that the base_frequency displayed by the cpufreq sysfs is correct::
207
208 # cat /sys/devices/system/cpu/cpu0/cpufreq/base_frequency
209 2600000
210
211 This matches the base-frequency (MHz) field value displayed from the
212 "perf-profile info" command for performance level 0(cpufreq frequency is in
213 KHz).
214
215 To check if the average frequency is equal to the base frequency for a 100% busy
216 workload, disable turbo::
217
218 # echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
219
220 Then runs a busy workload on all CPUs, for example::
221
222 #stress -c 64
223
224 To verify the base frequency, run turbostat::
225
226 #turbostat -c 0-13 --show Package,Core,CPU,Bzy_MHz -i 1
227
228 Package Core CPU Bzy_MHz
229 - - 2600
230 0 0 0 2600
231 0 1 1 2600
232 0 2 2 2600
233 0 3 3 2600
234 0 4 4 2600
235 . . . .
236
237
238 Changing performance level
239 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
240
241 To the change the performance level to 4, execute::
242
243 # intel-speed-select -d perf-profile set-config-level -l 4 -o
244 Intel(R) Speed Select Technology
245 Executing on CPU model: X
246 package-0
247 die-0
248 cpu-0
249 perf-profile
250 set_tdp_level:success
251
252 In the command above, "-o" is optional. If it is specified, then it will also
253 offline CPUs which are not present in the enable_cpu_mask for this performance
254 level.
255
256 Now if the base_frequency is checked::
257
258 #cat /sys/devices/system/cpu/cpu0/cpufreq/base_frequency
259 2800000
260
261 Which shows that the base frequency now increased from 2600 MHz at performance
262 level 0 to 2800 MHz at performance level 4. As a result, any workload, which can
263 use fewer CPUs, can see a boost of 200 MHz compared to performance level 0.
264
265 Changing performance level via BMC Interface
266 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
267
268 It is possible to change SST-PP level using out of band (OOB) agent (Via some
269 remote management console, through BMC "Baseboard Management Controller"
270 interface). This mode is supported from the Sapphire Rapids processor
271 generation. The kernel and tool change to support this mode is added to Linux
272 kernel version 5.18. To enable this feature, kernel config
273 "CONFIG_INTEL_HFI_THERMAL" is required. The minimum version of the tool
274 is "v1.12" to support this feature, which is part of Linux kernel version 5.18.
275
276 To support such configuration, this tool can be used as a daemon. Add
277 a command line option --oob::
278
279 # intel-speed-select --oob
280 Intel(R) Speed Select Technology
281 Executing on CPU model:143[0x8f]
282 OOB mode is enabled and will run as daemon
283
284 In this mode the tool will online/offline CPUs based on the new performance
285 level.
286
287 Check presence of other Intel(R) SST features
288 ---------------------------------------------
289
290 Each of the performance profiles also specifies weather there is support of
291 other two Intel(R) SST features (Intel(R) Speed Select Technology - Base Frequency
292 (Intel(R) SST-BF) and Intel(R) Speed Select Technology - Turbo Frequency (Intel
293 SST-TF)).
294
295 For example, from the output of "perf-profile info" above, for level 0 and level
296 4:
297
298 For level 0::
299 speed-select-turbo-freq:disabled
300 speed-select-base-freq:disabled
301
302 For level 4::
303 speed-select-turbo-freq:disabled
304 speed-select-base-freq:unsupported
305
306 Given these results, the "speed-select-base-freq" (Intel(R) SST-BF) in level 4
307 changed from "disabled" to "unsupported" compared to performance level 0.
308
309 This means that at performance level 4, the "speed-select-base-freq" feature is
310 not supported. However, at performance level 0, this feature is "supported", but
311 currently "disabled", meaning the user has not activated this feature. Whereas
312 "speed-select-turbo-freq" (Intel(R) SST-TF) is supported at both performance
313 levels, but currently not activated by the user.
314
315 The Intel(R) SST-BF and the Intel(R) SST-TF features are built on a foundation
316 technology called Intel(R) Speed Select Technology - Core Power (Intel(R) SST-CP).
317 The platform firmware enables this feature when Intel(R) SST-BF or Intel(R) SST-TF
318 is supported on a platform.
319
320 Intel(R) Speed Select Technology Core Power (Intel(R) SST-CP)
321 ---------------------------------------------------------------
322
323 Intel(R) Speed Select Technology Core Power (Intel(R) SST-CP) is an interface that
324 allows users to define per core priority. This defines a mechanism to distribute
325 power among cores when there is a power constrained scenario. This defines a
326 class of service (CLOS) configuration.
327
328 The user can configure up to 4 class of service configurations. Each CLOS group
329 configuration allows definitions of parameters, which affects how the frequency
330 can be limited and power is distributed. Each CPU core can be tied to a class of
331 service and hence an associated priority. The granularity is at core level not
332 at per CPU level.
333
334 Enable CLOS based prioritization
335 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
336
337 To use CLOS based prioritization feature, firmware must be informed to enable
338 and use a priority type. There is a default per platform priority type, which
339 can be changed with optional command line parameter.
340
341 To enable and check the options, execute::
342
343 # intel-speed-select core-power enable --help
344 Intel(R) Speed Select Technology
345 Executing on CPU model: X
346 Enable core-power for a package/die
347 Clos Enable: Specify priority type with [--priority|-p]
348 0: Proportional, 1: Ordered
349
350 There are two types of priority types:
351
352 - Ordered
353
354 Priority for ordered throttling is defined based on the index of the assigned
355 CLOS group. Where CLOS0 gets highest priority (throttled last).
356
357 Priority order is:
358 CLOS0 > CLOS1 > CLOS2 > CLOS3.
359
360 - Proportional
361
362 When proportional priority is used, there is an additional parameter called
363 frequency_weight, which can be specified per CLOS group. The goal of
364 proportional priority is to provide each core with the requested min., then
365 distribute all remaining (excess/deficit) budgets in proportion to a defined
366 weight. This proportional priority can be configured using "core-power config"
367 command.
368
369 To enable with the platform default priority type, execute::
370
371 # intel-speed-select core-power enable
372 Intel(R) Speed Select Technology
373 Executing on CPU model: X
374 package-0
375 die-0
376 cpu-0
377 core-power
378 enable:success
379 package-1
380 die-0
381 cpu-6
382 core-power
383 enable:success
384
385 The scope of this enable is per package or die scoped when a package contains
386 multiple dies. To check if CLOS is enabled and get priority type, "core-power
387 info" command can be used. For example to check the status of core-power feature
388 on CPU 0, execute::
389
390 # intel-speed-select -c 0 core-power info
391 Intel(R) Speed Select Technology
392 Executing on CPU model: X
393 package-0
394 die-0
395 cpu-0
396 core-power
397 support-status:supported
398 enable-status:enabled
399 clos-enable-status:enabled
400 priority-type:proportional
401 package-1
402 die-0
403 cpu-24
404 core-power
405 support-status:supported
406 enable-status:enabled
407 clos-enable-status:enabled
408 priority-type:proportional
409
410 Configuring CLOS groups
411 ~~~~~~~~~~~~~~~~~~~~~~~
412
413 Each CLOS group has its own attributes including min, max, freq_weight and
414 desired. These parameters can be configured with "core-power config" command.
415 Defaults will be used if user skips setting a parameter except clos id, which is
416 mandatory. To check core-power config options, execute::
417
418 # intel-speed-select core-power config --help
419 Intel(R) Speed Select Technology
420 Executing on CPU model: X
421 Set core-power configuration for one of the four clos ids
422 Specify targeted clos id with [--clos|-c]
423 Specify clos Proportional Priority [--weight|-w]
424 Specify clos min in MHz with [--min|-n]
425 Specify clos max in MHz with [--max|-m]
426
427 For example::
428
429 # intel-speed-select core-power config -c 0
430 Intel(R) Speed Select Technology
431 Executing on CPU model: X
432 clos epp is not specified, default: 0
433 clos frequency weight is not specified, default: 0
434 clos min is not specified, default: 0 MHz
435 clos max is not specified, default: 25500 MHz
436 clos desired is not specified, default: 0
437 package-0
438 die-0
439 cpu-0
440 core-power
441 config:success
442 package-1
443 die-0
444 cpu-6
445 core-power
446 config:success
447
448 The user has the option to change defaults. For example, the user can change the
449 "min" and set the base frequency to always get guaranteed base frequency.
450
451 Get the current CLOS configuration
452 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
453
454 To check the current configuration, "core-power get-config" can be used. For
455 example, to get the configuration of CLOS 0::
456
457 # intel-speed-select core-power get-config -c 0
458 Intel(R) Speed Select Technology
459 Executing on CPU model: X
460 package-0
461 die-0
462 cpu-0
463 core-power
464 clos:0
465 epp:0
466 clos-proportional-priority:0
467 clos-min:0 MHz
468 clos-max:Max Turbo frequency
469 clos-desired:0 MHz
470 package-1
471 die-0
472 cpu-24
473 core-power
474 clos:0
475 epp:0
476 clos-proportional-priority:0
477 clos-min:0 MHz
478 clos-max:Max Turbo frequency
479 clos-desired:0 MHz
480
481 Associating a CPU with a CLOS group
482 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
483
484 To associate a CPU to a CLOS group "core-power assoc" command can be used::
485
486 # intel-speed-select core-power assoc --help
487 Intel(R) Speed Select Technology
488 Executing on CPU model: X
489 Associate a clos id to a CPU
490 Specify targeted clos id with [--clos|-c]
491
492
493 For example to associate CPU 10 to CLOS group 3, execute::
494
495 # intel-speed-select -c 10 core-power assoc -c 3
496 Intel(R) Speed Select Technology
497 Executing on CPU model: X
498 package-0
499 die-0
500 cpu-10
501 core-power
502 assoc:success
503
504 Once a CPU is associated, its sibling CPUs are also associated to a CLOS group.
505 Once associated, avoid changing Linux "cpufreq" subsystem scaling frequency
506 limits.
507
508 To check the existing association for a CPU, "core-power get-assoc" command can
509 be used. For example, to get association of CPU 10, execute::
510
511 # intel-speed-select -c 10 core-power get-assoc
512 Intel(R) Speed Select Technology
513 Executing on CPU model: X
514 package-1
515 die-0
516 cpu-10
517 get-assoc
518 clos:3
519
520 This shows that CPU 10 is part of a CLOS group 3.
521
522
523 Disable CLOS based prioritization
524 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
525
526 To disable, execute::
527
528 # intel-speed-select core-power disable
529
530 Some features like Intel(R) SST-TF can only be enabled when CLOS based prioritization
531 is enabled. For this reason, disabling while Intel(R) SST-TF is enabled can cause
532 Intel(R) SST-TF to fail. This will cause the "disable" command to display an error
533 if Intel(R) SST-TF is already enabled. In turn, to disable, the Intel(R) SST-TF
534 feature must be disabled first.
535
536 Intel(R) Speed Select Technology - Base Frequency (Intel(R) SST-BF)
537 -------------------------------------------------------------------
538
539 The Intel(R) Speed Select Technology - Base Frequency (Intel(R) SST-BF) feature lets
540 the user control base frequency. If some critical workload threads demand
541 constant high guaranteed performance, then this feature can be used to execute
542 the thread at higher base frequency on specific sets of CPUs (high priority
543 CPUs) at the cost of lower base frequency (low priority CPUs) on other CPUs.
544 This feature does not require offline of the low priority CPUs.
545
546 The support of Intel(R) SST-BF depends on the Intel(R) Speed Select Technology -
547 Performance Profile (Intel(R) SST-PP) performance level configuration. It is
548 possible that only certain performance levels support Intel(R) SST-BF. It is also
549 possible that only base performance level (level = 0) has support of Intel
550 SST-BF. Consequently, first select the desired performance level to enable this
551 feature.
552
553 In the system under test here, Intel(R) SST-BF is supported at the base
554 performance level 0, but currently disabled. For example for the level 0::
555
556 # intel-speed-select -c 0 perf-profile info -l 0
557 Intel(R) Speed Select Technology
558 Executing on CPU model: X
559 package-0
560 die-0
561 cpu-0
562 perf-profile-level-0
563 ...
564
565 speed-select-base-freq:disabled
566 ...
567
568 Before enabling Intel(R) SST-BF and measuring its impact on a workload
569 performance, execute some workload and measure performance and get a baseline
570 performance to compare against.
571
572 Here the user wants more guaranteed performance. For this reason, it is likely
573 that turbo is disabled. To disable turbo, execute::
574
575 #echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
576
577 Based on the output of the "intel-speed-select perf-profile info -l 0" base
578 frequency of guaranteed frequency 2600 MHz.
579
580
581 Measure baseline performance for comparison
582 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
583
584 To compare, pick a multi-threaded workload where each thread can be scheduled on
585 separate CPUs. "Hackbench pipe" test is a good example on how to improve
586 performance using Intel(R) SST-BF.
587
588 Below, the workload is measuring average scheduler wakeup latency, so a lower
589 number means better performance::
590
591 # taskset -c 3,4 perf bench -r 100 sched pipe
592 # Running 'sched/pipe' benchmark:
593 # Executed 1000000 pipe operations between two processes
594 Total time: 6.102 [sec]
595 6.102445 usecs/op
596 163868 ops/sec
597
598 While running the above test, if we take turbostat output, it will show us that
599 2 of the CPUs are busy and reaching max. frequency (which would be the base
600 frequency as the turbo is disabled). The turbostat output::
601
602 #turbostat -c 0-13 --show Package,Core,CPU,Bzy_MHz -i 1
603 Package Core CPU Bzy_MHz
604 0 0 0 1000
605 0 1 1 1005
606 0 2 2 1000
607 0 3 3 2600
608 0 4 4 2600
609 0 5 5 1000
610 0 6 6 1000
611 0 7 7 1005
612 0 8 8 1005
613 0 9 9 1000
614 0 10 10 1000
615 0 11 11 995
616 0 12 12 1000
617 0 13 13 1000
618
619 From the above turbostat output, both CPU 3 and 4 are very busy and reaching
620 full guaranteed frequency of 2600 MHz.
621
622 Intel(R) SST-BF Capabilities
623 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
624
625 To get capabilities of Intel(R) SST-BF for the current performance level 0,
626 execute::
627
628 # intel-speed-select base-freq info -l 0
629 Intel(R) Speed Select Technology
630 Executing on CPU model: X
631 package-0
632 die-0
633 cpu-0
634 speed-select-base-freq
635 high-priority-base-frequency(MHz):3000
636 high-priority-cpu-mask:00000216,00002160
637 high-priority-cpu-list:5,6,8,13,33,34,36,41
638 low-priority-base-frequency(MHz):2400
639 tjunction-temperature(C):125
640 thermal-design-power(W):205
641
642 The above capabilities show that there are some CPUs on this system that can
643 offer base frequency of 3000 MHz compared to the standard base frequency at this
644 performance levels. Nevertheless, these CPUs are fixed, and they are presented
645 via high-priority-cpu-list/high-priority-cpu-mask. But if this Intel(R) SST-BF
646 feature is selected, the low priorities CPUs (which are not in
647 high-priority-cpu-list) can only offer up to 2400 MHz. As a result, if this
648 clipping of low priority CPUs is acceptable, then the user can enable Intel
649 SST-BF feature particularly for the above "sched pipe" workload since only two
650 CPUs are used, they can be scheduled on high priority CPUs and can get boost of
651 400 MHz.
652
653 Enable Intel(R) SST-BF
654 ~~~~~~~~~~~~~~~~~~~~~~
655
656 To enable Intel(R) SST-BF feature, execute::
657
658 # intel-speed-select base-freq enable -a
659 Intel(R) Speed Select Technology
660 Executing on CPU model: X
661 package-0
662 die-0
663 cpu-0
664 base-freq
665 enable:success
666 package-1
667 die-0
668 cpu-14
669 base-freq
670 enable:success
671
672 In this case, -a option is optional. This not only enables Intel(R) SST-BF, but it
673 also adjusts the priority of cores using Intel(R) Speed Select Technology Core
674 Power (Intel(R) SST-CP) features. This option sets the minimum performance of each
675 Intel(R) Speed Select Technology - Performance Profile (Intel(R) SST-PP) class to
676 maximum performance so that the hardware will give maximum performance possible
677 for each CPU.
678
679 If -a option is not used, then the following steps are required before enabling
680 Intel(R) SST-BF:
681
682 - Discover Intel(R) SST-BF and note low and high priority base frequency
683 - Note the high priority CPU list
684 - Enable CLOS using core-power feature set
685 - Configure CLOS parameters. Use CLOS.min to set to minimum performance
686 - Subscribe desired CPUs to CLOS groups
687
688 With this configuration, if the same workload is executed by pinning the
689 workload to high priority CPUs (CPU 5 and 6 in this case)::
690
691 #taskset -c 5,6 perf bench -r 100 sched pipe
692 # Running 'sched/pipe' benchmark:
693 # Executed 1000000 pipe operations between two processes
694 Total time: 5.627 [sec]
695 5.627922 usecs/op
696 177685 ops/sec
697
698 This way, by enabling Intel(R) SST-BF, the performance of this benchmark is
699 improved (latency reduced) by 7.79%. From the turbostat output, it can be
700 observed that the high priority CPUs reached 3000 MHz compared to 2600 MHz.
701 The turbostat output::
702
703 #turbostat -c 0-13 --show Package,Core,CPU,Bzy_MHz -i 1
704 Package Core CPU Bzy_MHz
705 0 0 0 2151
706 0 1 1 2166
707 0 2 2 2175
708 0 3 3 2175
709 0 4 4 2175
710 0 5 5 3000
711 0 6 6 3000
712 0 7 7 2180
713 0 8 8 2662
714 0 9 9 2176
715 0 10 10 2175
716 0 11 11 2176
717 0 12 12 2176
718 0 13 13 2661
719
720 Disable Intel(R) SST-BF
721 ~~~~~~~~~~~~~~~~~~~~~~~
722
723 To disable the Intel(R) SST-BF feature, execute::
724
725 # intel-speed-select base-freq disable -a
726
727
728 Intel(R) Speed Select Technology - Turbo Frequency (Intel(R) SST-TF)
729 --------------------------------------------------------------------
730
731 This feature enables the ability to set different "All core turbo ratio limits"
732 to cores based on the priority. By using this feature, some cores can be
733 configured to get higher turbo frequency by designating them as high priority at
734 the cost of lower or no turbo frequency on the low priority cores.
735
736 For this reason, this feature is only useful when system is busy utilizing all
737 CPUs, but the user wants some configurable option to get high performance on
738 some CPUs.
739
740 The support of Intel(R) Speed Select Technology - Turbo Frequency (Intel(R) SST-TF)
741 depends on the Intel(R) Speed Select Technology - Performance Profile (Intel
742 SST-PP) performance level configuration. It is possible that only a certain
743 performance level supports Intel(R) SST-TF. It is also possible that only the base
744 performance level (level = 0) has the support of Intel(R) SST-TF. Hence, first
745 select the desired performance level to enable this feature.
746
747 In the system under test here, Intel(R) SST-TF is supported at the base
748 performance level 0, but currently disabled::
749
750 # intel-speed-select -c 0 perf-profile info -l 0
751 Intel(R) Speed Select Technology
752 package-0
753 die-0
754 cpu-0
755 perf-profile-level-0
756 ...
757 ...
758 speed-select-turbo-freq:disabled
759 ...
760 ...
761
762
763 To check if performance can be improved using Intel(R) SST-TF feature, get the turbo
764 frequency properties with Intel(R) SST-TF enabled and compare to the base turbo
765 capability of this system.
766
767 Get Base turbo capability
768 ~~~~~~~~~~~~~~~~~~~~~~~~~
769
770 To get the base turbo capability of performance level 0, execute::
771
772 # intel-speed-select perf-profile info -l 0
773 Intel(R) Speed Select Technology
774 Executing on CPU model: X
775 package-0
776 die-0
777 cpu-0
778 perf-profile-level-0
779 ...
780 ...
781 turbo-ratio-limits-sse
782 bucket-0
783 core-count:2
784 max-turbo-frequency(MHz):3200
785 bucket-1
786 core-count:4
787 max-turbo-frequency(MHz):3100
788 bucket-2
789 core-count:6
790 max-turbo-frequency(MHz):3100
791 bucket-3
792 core-count:8
793 max-turbo-frequency(MHz):3100
794 bucket-4
795 core-count:10
796 max-turbo-frequency(MHz):3100
797 bucket-5
798 core-count:12
799 max-turbo-frequency(MHz):3100
800 bucket-6
801 core-count:14
802 max-turbo-frequency(MHz):3100
803 bucket-7
804 core-count:16
805 max-turbo-frequency(MHz):3100
806
807 Based on the data above, when all the CPUS are busy, the max. frequency of 3100
808 MHz can be achieved. If there is some busy workload on cpu 0 - 11 (e.g. stress)
809 and on CPU 12 and 13, execute "hackbench pipe" workload::
810
811 # taskset -c 12,13 perf bench -r 100 sched pipe
812 # Running 'sched/pipe' benchmark:
813 # Executed 1000000 pipe operations between two processes
814 Total time: 5.705 [sec]
815 5.705488 usecs/op
816 175269 ops/sec
817
818 The turbostat output::
819
820 #turbostat -c 0-13 --show Package,Core,CPU,Bzy_MHz -i 1
821 Package Core CPU Bzy_MHz
822 0 0 0 3000
823 0 1 1 3000
824 0 2 2 3000
825 0 3 3 3000
826 0 4 4 3000
827 0 5 5 3100
828 0 6 6 3100
829 0 7 7 3000
830 0 8 8 3100
831 0 9 9 3000
832 0 10 10 3000
833 0 11 11 3000
834 0 12 12 3100
835 0 13 13 3100
836
837 Based on turbostat output, the performance is limited by frequency cap of 3100
838 MHz. To check if the hackbench performance can be improved for CPU 12 and CPU
839 13, first check the capability of the Intel(R) SST-TF feature for this performance
840 level.
841
842 Get Intel(R) SST-TF Capability
843 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
844
845 To get the capability, the "turbo-freq info" command can be used::
846
847 # intel-speed-select turbo-freq info -l 0
848 Intel(R) Speed Select Technology
849 Executing on CPU model: X
850 package-0
851 die-0
852 cpu-0
853 speed-select-turbo-freq
854 bucket-0
855 high-priority-cores-count:2
856 high-priority-max-frequency(MHz):3200
857 high-priority-max-avx2-frequency(MHz):3200
858 high-priority-max-avx512-frequency(MHz):3100
859 bucket-1
860 high-priority-cores-count:4
861 high-priority-max-frequency(MHz):3100
862 high-priority-max-avx2-frequency(MHz):3000
863 high-priority-max-avx512-frequency(MHz):2900
864 bucket-2
865 high-priority-cores-count:6
866 high-priority-max-frequency(MHz):3100
867 high-priority-max-avx2-frequency(MHz):3000
868 high-priority-max-avx512-frequency(MHz):2900
869 speed-select-turbo-freq-clip-frequencies
870 low-priority-max-frequency(MHz):2600
871 low-priority-max-avx2-frequency(MHz):2400
872 low-priority-max-avx512-frequency(MHz):2100
873
874 Based on the output above, there is an Intel(R) SST-TF bucket for which there are
875 two high priority cores. If only two high priority cores are set, then max.
876 turbo frequency on those cores can be increased to 3200 MHz. This is 100 MHz
877 more than the base turbo capability for all cores.
878
879 In turn, for the hackbench workload, two CPUs can be set as high priority and
880 rest as low priority. One side effect is that once enabled, the low priority
881 cores will be clipped to a lower frequency of 2600 MHz.
882
883 Enable Intel(R) SST-TF
884 ~~~~~~~~~~~~~~~~~~~~~~
885
886 To enable Intel(R) SST-TF, execute::
887
888 # intel-speed-select -c 12,13 turbo-freq enable -a
889 Intel(R) Speed Select Technology
890 Executing on CPU model: X
891 package-0
892 die-0
893 cpu-12
894 turbo-freq
895 enable:success
896 package-0
897 die-0
898 cpu-13
899 turbo-freq
900 enable:success
901 package--1
902 die-0
903 cpu-63
904 turbo-freq --auto
905 enable:success
906
907 In this case, the option "-a" is optional. If set, it enables Intel(R) SST-TF
908 feature and also sets the CPUs to high and low priority using Intel Speed
909 Select Technology Core Power (Intel(R) SST-CP) features. The CPU numbers passed
910 with "-c" arguments are marked as high priority, including its siblings.
911
912 If -a option is not used, then the following steps are required before enabling
913 Intel(R) SST-TF:
914
915 - Discover Intel(R) SST-TF and note buckets of high priority cores and maximum frequency
916
917 - Enable CLOS using core-power feature set - Configure CLOS parameters
918
919 - Subscribe desired CPUs to CLOS groups making sure that high priority cores are set to the maximum frequency
920
921 If the same hackbench workload is executed, schedule hackbench threads on high
922 priority CPUs::
923
924 #taskset -c 12,13 perf bench -r 100 sched pipe
925 # Running 'sched/pipe' benchmark:
926 # Executed 1000000 pipe operations between two processes
927 Total time: 5.510 [sec]
928 5.510165 usecs/op
929 180826 ops/sec
930
931 This improved performance by around 3.3% improvement on a busy system. Here the
932 turbostat output will show that the CPU 12 and CPU 13 are getting 100 MHz boost.
933 The turbostat output::
934
935 #turbostat -c 0-13 --show Package,Core,CPU,Bzy_MHz -i 1
936 Package Core CPU Bzy_MHz
937 ...
938 0 12 12 3200
939 0 13 13 3200
940

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Intel SST와 configuration tool

1-78

이 문서는 `SPDX-License-Identifier: GPL-2.0`을 따릅니다. Intel(R) Speed Select Technology(Intel(R) SST)는 CPU performance를 더 세밀하게 제어하는 기능 모음으로, server 한 대를 다양한 workload의 power와 performance 요구에 맞게 구성할 수 있습니다.

기술 개요는 `https://www.intel.com/content/www/us/en/architecture-and-technology/speed-select-technology-article.html`과 `https://builders.intel.com/docs/networkbuilders/intel-speed-select-technology-base-frequency-enhancing-performance.pdf`를 참조하십시오.

새 server platform 세대 일부에서는 BIOS setup option으로 미리 구성하지 않고 hardware mailbox command를 통해 기능을 동적으로 열거하고 제어할 수 있습니다. Intel Speed Select utility는 이를 수행하는 한 가지 방법입니다. 이 문서는 tool의 command와 system power·performance profile 변화 예를 설명하며, 사용자는 tool이 구현한 messaging을 production software에서 재현할 수 있습니다.

대부분의 Linux distribution package에 `intel-speed-select` tool이 포함될 수 있습니다. 없다면 kernel.org에서 Linux kernel tree를 받아 전체 kernel을 build하지 않고 다음 command로 tool만 build하고 install할 수 있습니다.

# cd tools/power/x86/intel-speed-select/
# make
# make install

Top-level help는 argument와 feature를 설명하며 tool에는 여러 단계의 help 구조가 있습니다. 다음 command는 전체 help, `perf-profile` feature help, 그 안의 `info` command help를 차례로 확인합니다.

# intel-speed-select --help
# intel-speed-select perf-profile --help
# intel-speed-select perf-profile info --help

현재 platform과 driver capability는 `--info`로 확인합니다. Example output은 API·driver version, mailbox와 MMIO 지원, SST-PP의 lock과 maximum level, SST-TF·SST-BF·SST-CP 지원 여부를 보여 줍니다.

#intel-speed-select --info
# intel-speed-select --info
Intel(R) Speed Select Technology
Executing on CPU model: X
Platform: API version : 1
Platform: Driver version : 1
Platform: mbox supported : 1
Platform: mmio supported : 1
Intel(R) SST-PP (feature perf-profile) is supported
TDP level change control is unlocked, max level: 4
Intel(R) SST-TF (feature turbo-freq) is supported
Intel(R) SST-BF (feature base-freq) is not supported
Intel(R) SST-CP (feature core-power) is supported

SST-PP profile 수와 lock

79-137

SST-PP(Intel(R) Speed Select Technology - Performance Profile)는 workload performance 요구에 따라 server configuration을 동적으로 바꿉니다. System마다 여러 optimized profile이 있고 각 profile은 guaranteed base frequency를 유지하기 위해 online이어야 할 CPU 집합과 offline이어야 할 나머지 CPU를 정의합니다. Tool에서는 이 기능을 `perf-profile`이라 부릅니다.

`get-config-levels`는 performance profile 수를 확인합니다. Example system은 base profile인 level 0 외에 profile 4개가 있습니다.

# intel-speed-select perf-profile get-config-levels
Intel(R) Speed Select Technology
Executing on CPU model: X
package-0
 die-0
   cpu-0
       get-config-levels:4
package-1
 die-0
   cpu-14
       get-config-levels:4

여러 profile이 있어도 lock되어 있으면 performance state를 바꿀 수 없습니다. BIOS setup에서 unlock할 수 있는지 system vendor에 확인해야 할 수 있습니다. `get-lock-status` 결과 0은 system이 unlocked임을 뜻합니다.

# intel-speed-select perf-profile get-lock-status
Intel(R) Speed Select Technology
Executing on CPU model: X
package-0
 die-0
   cpu-0
       get-lock-status:0
package-1
 die-0
   cpu-14
       get-lock-status:0

SST-PP property와 현재 level 검증

138-237

`perf-profile info -l 0`은 level 0의 CPU 수, online 허용 mask와 list, TDP ratio, base frequency, SST-TF·SST-BF 상태를 보여 줍니다. `-l`을 생략하면 모든 level 정보를 출력합니다.

# intel-speed-select perf-profile info -l 0
Intel(R) Speed Select Technology
Executing on CPU model: X
package-0
 die-0
   cpu-0
     perf-profile-level-0
       cpu-count:28
       enable-cpu-mask:000003ff,f0003fff
       enable-cpu-list:0,1,2,3,4,5,6,7,8,9,10,11,12,13,28,29,30,31,32,33,34,35,36,37,38,39,40,41
       thermal-design-power-ratio:26
       base-frequency(MHz):2600
       speed-select-turbo-freq:disabled
       speed-select-base-freq:disabled
       ...
       ...

Level 0에서는 `enable-cpu-mask`와 `enable-cpu-list`에 표시된 CPU까지만 online일 때 2600 MHz base frequency를 유지할 수 있습니다. Level 4는 online CPU가 더 적고 나머지를 offline으로 유지하면 base frequency가 level 0의 2.6 GHz에서 2.8 GHz로 올라갑니다.

# intel-speed-select perf-profile info -l 4
Intel(R) Speed Select Technology
Executing on CPU model: X
package-0
 die-0
   cpu-0
     perf-profile-level-4
       cpu-count:28
       enable-cpu-mask:000000fa,f0000faf
       enable-cpu-list:0,1,2,3,5,7,8,9,10,11,28,29,30,31,33,35,36,37,38,39
       thermal-design-power-ratio:28
       base-frequency(MHz):2800
       speed-select-turbo-freq:disabled
       speed-select-base-freq:unsupported
       ...
       ...

`get-config-current-level`은 현재 level을 확인합니다. 이어서 cpufreq `base_frequency`가 level 0의 `base-frequency(MHz)` 2600과 일치하는지 확인합니다. Cpufreq frequency 단위는 KHz이므로 2600000으로 표시됩니다.

# intel-speed-select perf-profile get-config-current-level
Intel(R) Speed Select Technology
Executing on CPU model: X
package-0
 die-0
   cpu-0
       get-config-current_level:0
# cat /sys/devices/system/cpu/cpu0/cpufreq/base_frequency
2600000

100% busy workload의 average frequency가 base frequency와 같은지 확인하려면 turbo를 끄고 모든 CPU에 busy workload를 실행한 뒤 `turbostat`으로 확인합니다. Example에서는 각 CPU의 `Bzy_MHz`가 2600입니다.

# echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
#stress -c 64
#turbostat -c 0-13 --show Package,Core,CPU,Bzy_MHz -i 1

 Package        Core        CPU        Bzy_MHz
               -        -        2600
 0                0        0        2600
 0                1        1        2600
 0                2        2        2600
 0                3        3        2600
 0                4        4        2600
 .                .        .        .

SST-PP level 변경과 OOB mode

238-319

Performance level을 4로 바꾸려면 `set-config-level -l 4`를 사용합니다. Optional `-o`를 지정하면 이 level의 `enable_cpu_mask`에 없는 CPU도 offline으로 만듭니다. 변경 뒤 `base_frequency`는 2800000, 즉 2800 MHz가 되어 적은 CPU를 쓰는 workload가 level 0보다 200 MHz boost를 얻을 수 있습니다.

# intel-speed-select -d perf-profile set-config-level -l 4 -o
Intel(R) Speed Select Technology
Executing on CPU model: X
package-0
 die-0
   cpu-0
     perf-profile
       set_tdp_level:success
#cat /sys/devices/system/cpu/cpu0/cpufreq/base_frequency
2800000

Sapphire Rapids 세대부터 remote management console의 BMC(Baseboard Management Controller) interface를 통한 OOB(out of band) agent로 SST-PP level을 바꿀 수 있습니다. Linux 5.18부터 kernel과 tool이 지원하며 `CONFIG_INTEL_HFI_THERMAL`과 tool version `v1.12` 이상이 필요합니다. `--oob`로 daemon mode를 실행하면 새 performance level에 따라 CPU를 online 또는 offline으로 조정합니다.

# intel-speed-select --oob
Intel(R) Speed Select Technology
Executing on CPU model:143[0x8f]
OOB mode is enabled and will run as daemon

각 performance profile은 SST-BF와 SST-TF 지원 상태도 나타냅니다. Example에서 level 4의 `speed-select-base-freq`는 level 0의 `disabled`와 달리 `unsupported`이므로 기능 자체를 사용할 수 없습니다. Level 0의 SST-BF와 두 level의 SST-TF는 지원되지만 사용자가 아직 활성화하지 않은 `disabled` 상태입니다.

speed-select-turbo-freq:disabled
speed-select-base-freq:disabled
speed-select-turbo-freq:disabled
speed-select-base-freq:unsupported

SST-BF와 SST-TF는 foundation technology인 SST-CP(Intel(R) Speed Select Technology - Core Power) 위에 구축되며, platform이 SST-BF 또는 SST-TF를 지원하면 firmware가 SST-CP를 활성화합니다.

SST-CP와 CLOS priority 활성화

320-409

SST-CP는 user가 core별 priority를 정의하여 power-constrained scenario에서 core 사이 power distribution을 제어하는 CLOS(class of service) configuration입니다. 최대 4개 CLOS group을 만들 수 있고 각 group의 parameter가 frequency limit과 power 배분에 영향을 줍니다. CPU가 아니라 core 단위이며 core마다 CLOS와 priority를 연결합니다.

CLOS priority를 사용하려면 firmware에 enable과 priority type을 알려야 합니다. Platform별 default type이 있고 optional command-line parameter로 바꿀 수 있습니다.

# intel-speed-select core-power enable --help
Intel(R) Speed Select Technology
Executing on CPU model: X
Enable core-power for a package/die
       Clos Enable: Specify priority type with [--priority|-p]
                0: Proportional, 1: Ordered

Ordered throttling에서는 assigned CLOS index가 priority를 정하며 `CLOS0 > CLOS1 > CLOS2 > CLOS3` 순서로 CLOS0이 마지막에 throttle됩니다. Proportional priority에서는 CLOS별 `frequency_weight`를 사용하여 각 core에 requested minimum을 먼저 제공한 뒤 남거나 부족한 budget을 weight 비율로 배분합니다.

Default priority type으로 활성화하는 scope는 package별이며, multi-die package에서는 die별입니다. `core-power info`는 지원, enable, CLOS enable, priority type을 확인합니다.

# intel-speed-select core-power enable
Intel(R) Speed Select Technology
Executing on CPU model: X
package-0
 die-0
   cpu-0
     core-power
       enable:success
package-1
 die-0
   cpu-6
     core-power
       enable:success
# intel-speed-select -c 0 core-power info
Intel(R) Speed Select Technology
Executing on CPU model: X
package-0
 die-0
   cpu-0
     core-power
       support-status:supported
       enable-status:enabled
       clos-enable-status:enabled
       priority-type:proportional
package-1
 die-0
   cpu-24
     core-power
       support-status:supported
       enable-status:enabled
       clos-enable-status:enabled
       priority-type:proportional

CLOS group configuration

410-480

각 CLOS group에는 `min`, `max`, `freq_weight`, `desired` attribute가 있으며 `core-power config`로 설정합니다. CLOS ID는 필수이고 나머지는 생략하면 default를 사용합니다.

# intel-speed-select core-power config --help
Intel(R) Speed Select Technology
Executing on CPU model: X
Set core-power configuration for one of the four clos ids
       Specify targeted clos id with [--clos|-c]
       Specify clos Proportional Priority [--weight|-w]
       Specify clos min in MHz with [--min|-n]
       Specify clos max in MHz with [--max|-m]

Example은 CLOS 0을 default EPP 0, weight 0, minimum 0 MHz, maximum 25500 MHz, desired 0으로 두고 package별 configuration을 성공시킵니다. User는 `min`을 base frequency로 바꾸어 guaranteed base frequency를 항상 요구하는 등 default를 조정할 수 있습니다.

# intel-speed-select core-power config -c 0
Intel(R) Speed Select Technology
Executing on CPU model: X
clos epp is not specified, default: 0
clos frequency weight is not specified, default: 0
clos min is not specified, default: 0 MHz
clos max is not specified, default: 25500 MHz
clos desired is not specified, default: 0
package-0
 die-0
   cpu-0
     core-power
       config:success
package-1
 die-0
   cpu-6
     core-power
       config:success

`core-power get-config -c 0`은 CLOS 0의 현재 EPP, proportional priority, minimum, maximum, desired frequency를 package와 die별로 보여 줍니다.

# intel-speed-select core-power get-config -c 0
Intel(R) Speed Select Technology
Executing on CPU model: X
package-0
 die-0
   cpu-0
     core-power
       clos:0
       epp:0
       clos-proportional-priority:0
       clos-min:0 MHz
       clos-max:Max Turbo frequency
       clos-desired:0 MHz
package-1
 die-0
   cpu-24
     core-power
       clos:0
       epp:0
       clos-proportional-priority:0
       clos-min:0 MHz
       clos-max:Max Turbo frequency
       clos-desired:0 MHz

CPU와 CLOS 연결 및 비활성화

481-535

`core-power assoc`는 CPU를 CLOS group에 연결합니다. Help로 option을 확인한 뒤 example처럼 CPU 10을 CLOS 3에 연결할 수 있습니다.

# intel-speed-select core-power assoc --help
Intel(R) Speed Select Technology
Executing on CPU model: X
Associate a clos id to a CPU
       Specify targeted clos id with [--clos|-c]
# intel-speed-select -c 10 core-power assoc -c 3
Intel(R) Speed Select Technology
Executing on CPU model: X
package-0
 die-0
   cpu-10
     core-power
       assoc:success

CPU 하나를 연결하면 sibling CPU도 CLOS group에 연결됩니다. 연결 후에는 Linux `cpufreq` subsystem의 scaling frequency limit을 바꾸지 않는 것이 좋습니다. `core-power get-assoc`로 CPU 10이 CLOS 3에 속하는지 확인합니다.

# intel-speed-select -c 10 core-power get-assoc
Intel(R) Speed Select Technology
Executing on CPU model: X
package-1
 die-0
   cpu-10
     get-assoc
       clos:3

`core-power disable`은 CLOS prioritization을 끕니다. SST-TF는 CLOS가 켜져 있어야 활성화될 수 있으므로 SST-TF가 켜진 상태에서는 disable command가 error를 표시할 수 있고, SST-TF를 먼저 꺼야 합니다.

# intel-speed-select core-power disable

SST-BF 개요와 benchmark 준비

536-580

SST-BF(Intel(R) Speed Select Technology - Base Frequency)는 base frequency를 제어합니다. 일정하고 높은 guaranteed performance가 필요한 critical workload thread를 high-priority CPU에서 더 높은 base frequency로 실행하는 대신 다른 low-priority CPU의 base frequency를 낮춥니다. Low-priority CPU를 offline으로 만들 필요는 없습니다.

SST-BF 지원은 SST-PP performance level에 따라 달라지며 특정 level 또는 base level 0에서만 지원될 수 있으므로 원하는 performance level을 먼저 선택해야 합니다. Example system은 level 0에서 지원하지만 아직 disabled입니다.

# intel-speed-select -c 0 perf-profile info -l 0
Intel(R) Speed Select Technology
Executing on CPU model: X
package-0
 die-0
   cpu-0
     perf-profile-level-0
       ...

       speed-select-base-freq:disabled
       ...

SST-BF를 켜기 전 workload를 실행해 baseline performance를 측정합니다. Guaranteed performance를 원하므로 turbo를 끄며, `perf-profile info -l 0` 결과의 guaranteed base frequency는 2600 MHz입니다.

#echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo

SST-BF baseline과 capability

581-652

Thread마다 별도 CPU에 schedule할 수 있는 multi-threaded workload로 비교합니다. `perf bench sched pipe`는 average scheduler wakeup latency를 측정하므로 값이 낮을수록 좋습니다. CPU 3과 4에 pin한 baseline은 6.102445 usec/op, 163868 ops/sec입니다.

# taskset -c 3,4 perf bench -r 100 sched pipe
# Running 'sched/pipe' benchmark:
# Executed 1000000 pipe operations between two processes
    Total time: 6.102 [sec]
      6.102445 usecs/op
        163868 ops/sec

Turbo가 꺼진 동안 `turbostat`은 CPU 3과 4가 busy하며 guaranteed base frequency 2600 MHz에 도달했음을 보여 줍니다.

#turbostat -c 0-13 --show Package,Core,CPU,Bzy_MHz -i 1
Package        Core        CPU        Bzy_MHz
0                0        0        1000
0                1        1        1005
0                2        2        1000
0                3        3        2600
0                4        4        2600
0                5        5        1000
0                6        6        1000
0                7        7        1005
0                8        8        1005
0                9        9        1000
0                10        10        1000
0                11        11        995
0                12        12        1000
0                13        13        1000

`base-freq info -l 0`은 high-priority base 3000 MHz, 고정된 high-priority CPU mask와 list, low-priority base 2400 MHz, junction temperature와 TDP를 보여 줍니다. Low-priority CPU clipping을 받아들일 수 있다면 CPU 두 개만 쓰는 sched pipe workload를 high-priority CPU에 배치해 400 MHz boost를 얻을 수 있습니다.

# intel-speed-select base-freq info -l 0
Intel(R) Speed Select Technology
Executing on CPU model: X
package-0
 die-0
   cpu-0
     speed-select-base-freq
       high-priority-base-frequency(MHz):3000
       high-priority-cpu-mask:00000216,00002160
       high-priority-cpu-list:5,6,8,13,33,34,36,41
       low-priority-base-frequency(MHz):2400
       tjunction-temperature(C):125
       thermal-design-power(W):205

SST-BF 활성화와 결과

653-727

`base-freq enable -a`는 SST-BF를 활성화합니다. Optional `-a`는 SST-CP로 core priority도 조정하고 각 SST-PP class의 minimum performance를 maximum으로 설정하여 hardware가 CPU마다 가능한 maximum performance를 제공하게 합니다.

# intel-speed-select base-freq enable -a
Intel(R) Speed Select Technology
Executing on CPU model: X
package-0
 die-0
   cpu-0
     base-freq
       enable:success
package-1
 die-0
   cpu-14
     base-freq
       enable:success

`-a`를 쓰지 않으면 SST-BF capability와 low/high priority base frequency를 확인하고, high-priority CPU list를 기록하고, SST-CP CLOS를 활성화한 뒤 CLOS parameter의 minimum을 설정하고 원하는 CPU를 CLOS group에 연결해야 합니다.

High-priority CPU 5와 6에 같은 workload를 pin하면 5.627922 usec/op, 177685 ops/sec가 됩니다. SST-BF로 latency가 7.79% 줄었고 `turbostat`에서 high-priority CPU가 기존 2600 MHz 대신 3000 MHz에 도달합니다.

#taskset -c 5,6 perf bench -r 100 sched pipe
# Running 'sched/pipe' benchmark:
# Executed 1000000 pipe operations between two processes
    Total time: 5.627 [sec]
      5.627922 usecs/op
        177685 ops/sec
#turbostat -c 0-13 --show Package,Core,CPU,Bzy_MHz -i 1
Package        Core        CPU        Bzy_MHz
0                0        0        2151
0                1        1        2166
0                2        2        2175
0                3        3        2175
0                4        4        2175
0                5        5        3000
0                6        6        3000
0                7        7        2180
0                8        8        2662
0                9        9        2176
0                10        10        2175
0                11        11        2176
0                12        12        2176
0                13        13        2661

SST-BF를 끄려면 `base-freq disable -a`를 실행합니다.

# intel-speed-select base-freq disable -a

SST-TF 개요

728-766

SST-TF(Intel(R) Speed Select Technology - Turbo Frequency)는 priority에 따라 core별로 다른 all-core turbo ratio limit을 설정합니다. 일부 core를 high priority로 지정해 더 높은 turbo frequency를 주는 대신 low-priority core에는 낮거나 없는 turbo frequency를 적용합니다.

모든 CPU가 busy한 상황에서 일부 CPU 성능을 높이려 할 때 유용합니다. 지원 여부는 SST-PP level에 따라 다르며 특정 level 또는 base level 0에서만 지원될 수 있으므로 원하는 level을 먼저 선택해야 합니다.

Example system에서는 level 0에서 SST-TF가 지원되지만 `speed-select-turbo-freq:disabled` 상태입니다. SST-TF의 turbo property를 base turbo capability와 비교해 개선 가능성을 확인합니다.

# intel-speed-select -c 0 perf-profile info -l 0
Intel(R) Speed Select Technology
package-0
 die-0
   cpu-0
     perf-profile-level-0
       ...
       ...
       speed-select-turbo-freq:disabled
       ...
       ...

Base turbo capability와 baseline

767-841

`perf-profile info -l 0`은 SSE turbo-ratio bucket을 보여 줍니다. 두 core까지 3200 MHz이고 4개 이상 16개까지는 3100 MHz이므로 모든 CPU가 busy하면 maximum 3100 MHz입니다.

# intel-speed-select perf-profile info -l 0
Intel(R) Speed Select Technology
Executing on CPU model: X
package-0
 die-0
   cpu-0
     perf-profile-level-0
       ...
       ...
       turbo-ratio-limits-sse
         bucket-0
           core-count:2
           max-turbo-frequency(MHz):3200
         bucket-1
           core-count:4
           max-turbo-frequency(MHz):3100
         bucket-2
           core-count:6
           max-turbo-frequency(MHz):3100
         bucket-3
           core-count:8
           max-turbo-frequency(MHz):3100
         bucket-4
           core-count:10
           max-turbo-frequency(MHz):3100
         bucket-5
           core-count:12
           max-turbo-frequency(MHz):3100
         bucket-6
           core-count:14
           max-turbo-frequency(MHz):3100
         bucket-7
           core-count:16
           max-turbo-frequency(MHz):3100

CPU 0-11에 busy workload가 있고 CPU 12와 13에서 sched pipe를 실행한 baseline은 5.705488 usec/op, 175269 ops/sec입니다.

# taskset -c 12,13 perf bench -r 100 sched pipe
# Running 'sched/pipe' benchmark:
# Executed 1000000 pipe operations between two processes
    Total time: 5.705 [sec]
      5.705488 usecs/op
        175269 ops/sec

`turbostat`은 busy system에서 CPU 12와 13의 performance가 3100 MHz cap으로 제한됨을 보여 줍니다. 개선 가능성을 판단하려면 이 level의 SST-TF capability를 확인합니다.

#turbostat -c 0-13 --show Package,Core,CPU,Bzy_MHz -i 1
Package        Core        CPU        Bzy_MHz
0                0        0        3000
0                1        1        3000
0                2        2        3000
0                3        3        3000
0                4        4        3000
0                5        5        3100
0                6        6        3100
0                7        7        3000
0                8        8        3100
0                9        9        3000
0                10        10        3000
0                11        11        3000
0                12        12        3100
0                13        13        3100

SST-TF capability

842-882

`turbo-freq info -l 0`은 high-priority core 수에 따른 일반·AVX2·AVX512 maximum frequency bucket과 low-priority clipping frequency를 보여 줍니다.

# intel-speed-select turbo-freq info -l 0
Intel(R) Speed Select Technology
Executing on CPU model: X
package-0
 die-0
   cpu-0
     speed-select-turbo-freq
         bucket-0
           high-priority-cores-count:2
           high-priority-max-frequency(MHz):3200
           high-priority-max-avx2-frequency(MHz):3200
           high-priority-max-avx512-frequency(MHz):3100
         bucket-1
           high-priority-cores-count:4
           high-priority-max-frequency(MHz):3100
           high-priority-max-avx2-frequency(MHz):3000
           high-priority-max-avx512-frequency(MHz):2900
         bucket-2
           high-priority-cores-count:6
           high-priority-max-frequency(MHz):3100
           high-priority-max-avx2-frequency(MHz):3000
           high-priority-max-avx512-frequency(MHz):2900
         speed-select-turbo-freq-clip-frequencies
           low-priority-max-frequency(MHz):2600
           low-priority-max-avx2-frequency(MHz):2400
           low-priority-max-avx512-frequency(MHz):2100

High-priority core를 두 개만 지정하면 그 core의 maximum turbo frequency는 all-core base capability보다 100 MHz 높은 3200 MHz입니다. Hackbench용 CPU 두 개를 high priority로, 나머지를 low priority로 둘 수 있지만 low-priority core는 2600 MHz로 clipping되는 부작용이 있습니다.

SST-TF 활성화와 결과

883-939

`turbo-freq enable -a`는 지정 CPU에서 SST-TF를 활성화합니다. Optional `-a`는 SST-CP를 사용해 high·low priority도 함께 설정하며, `-c`로 전달한 CPU와 siblings를 high priority로 표시합니다.

# intel-speed-select -c 12,13 turbo-freq enable -a
Intel(R) Speed Select Technology
Executing on CPU model: X
package-0
 die-0
   cpu-12
     turbo-freq
       enable:success
package-0
 die-0
   cpu-13
     turbo-freq
       enable:success
package--1
 die-0
   cpu-63
     turbo-freq --auto
       enable:success

`-a`를 쓰지 않으면 SST-TF bucket과 high-priority core의 maximum frequency를 확인하고, SST-CP CLOS를 활성화·구성한 뒤 high-priority core가 maximum frequency를 사용하도록 원하는 CPU를 CLOS group에 연결해야 합니다.

High-priority CPU 12와 13에서 같은 hackbench workload를 실행한 결과는 5.510165 usec/op, 180826 ops/sec로 busy system에서 약 3.3% 향상됩니다. `turbostat`은 두 CPU가 100 MHz boost를 받아 3200 MHz로 실행됨을 보여 줍니다.

#taskset -c 12,13 perf bench -r 100 sched pipe
# Running 'sched/pipe' benchmark:
# Executed 1000000 pipe operations between two processes
    Total time: 5.510 [sec]
      5.510165 usecs/op
        180826 ops/sec
#turbostat -c 0-13 --show Package,Core,CPU,Bzy_MHz -i 1
Package        Core        CPU        Bzy_MHz
...
0                12        12        3200
0                13        13        3200