CPU 依據省電模式有區分為 Processor Operating States (C-states) 與 Processor Performance States (P-states)。
C-states: CPU 在沒有使用時可以被停用或以比較低的效能模式來運行,依據不同的 狀態可以區分成為幾種 C-state。 C-state 從 C0 (不閒置)開始,數字越高表示越省電(每一家的 CPU 定義 C-state 會稍微不同)。 CPU 的 C-state 有下面幾種。
C0 – Operating State C1 – Halt C1E – Enhanced Halt C2 – Stop Grant C2 – Stop Clock C2E – Extended Stop Grant C3 – Sleep C3 – Deep Sleep C3 – AltVID C4 – Deeper Sleep C4E/C5 -Enhanced Deeper Sleep C6 – Deep Power Down C7 – C6 + LLC may be flushed C8 – C7 + LLC must be flushed
P-States 就是指 CPU 依據目前狀態自行調整工作頻率,用以省電。
指令1 - cpupower
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
CPU 有支援哪一些指令,可以直接下cpupower
[root@localhost ~]# cpupower Usage: cpupower [-c|--cpu cpulist ] <command> [<args>] Supported commands are: frequency-info frequency-set idle-info idle-set set info monitor help
Not all commands can make use of the -c cpulist option.
Use 'cpupower help <command>'for getting helpfor above commands.
指令2 - cpupower idle-info
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
查詢CPU有支援的 C-State
[root@localhost ~]# cpupower idle-info CPUidle driver: acpi_idle CPUidle governor: menu analyzing CPU 0:
[root@localhost ~]# cpupower frequency-info analyzing CPU 0: no or unknown cpufreq driver is active on this CPU CPUs which run at the same hardware frequency: Not Available CPUs which need to have their frequency coordinated by software: Not Available maximum transition latency: Cannot determine or is not supported. Not Available available cpufreq governors: Not Available Unable to determine current policy current CPU frequency: Unable to call hardware current CPU frequency: Unable to call to kernel boost state support: Supported: yes Active: yes