AMD protsessor

Allikas: Imre kasutab arvutit
Mine navigeerimisribaleMine otsikasti

Sissejuhatus

TODO

Mõisted

  • CPUID - käsk protsessori omaduste küsimiseks, käsku saab täpsustada nt 'CPUID(0)' küsib tootja kohta, 'CPUID(6)' küsib tehniliste omaduste toe kohta

AMD protsessorid

TODO

Süsteemi protsessori omaduste muutmine

Väited

  • midagi saab muuta füüsilise arvuti puhul ja midagi virtuaalse arvuti puhul
  • põhimõtteliselt peaks 2025 aastal olema olukord selline, et käigult on ohutu muuta protsessorite arvuti ja sagedus-omadusi - süsteem käigult oskab tegevused lõpetada ja cache'id puhastada jne, või vastupidi

Protsessorite arv

Kui süsteemis on neli protsessorit kokku ja kaks on välja lülitatud, paistab olukord lscpu programmi väljundis selline

root@pwrk-02:~# lscpu
Architecture:             x86_64
  CPU op-mode(s):         32-bit, 64-bit
  Address sizes:          52 bits physical, 57 bits virtual
  Byte Order:             Little Endian
CPU(s):                   4
  On-line CPU(s) list:    0,1
  Off-line CPU(s) list:   2,3
Vendor ID:                AuthenticAMD
  BIOS Vendor ID:         QEMU
  Model name:             AMD Ryzen Threadripper PRO 7965WX 24-Cores
    BIOS Model name:      pc-q35-10.0  CPU @ 2.0GHz
    BIOS CPU family:      1
    CPU family:           25
    Model:                24
...

kus

  • On-line CPU(s) list: 0,1
  • Off-line CPU(s) list: 2,3

muudatuse tegemiseks sobib öelda

root@pwrk-02:~# echo 0 > /sys/devices/system/cpu/cpu3/online
root@pwrk-02:~# echo 0 > /sys/devices/system/cpu/cpu2/online

# dmesg -T
...

[Sat Oct 11 14:39:56 2025] smpboot: CPU 3 is now offline
[Sat Oct 11 14:40:00 2025] smpboot: CPU 2 is now offline

Tagasi lülitamiseks

root@pwrk-02:~# echo 1 > /sys/devices/system/cpu/cpu2/online
root@pwrk-02:~# echo 1 > /sys/devices/system/cpu/cpu3/online

# dmesg -T
...

[Sat Oct 11 14:42:33 2025] smpboot: Booting Node 0 Processor 2 APIC 0x2
[Sat Oct 11 14:42:39 2025] smpboot: Booting Node 0 Processor 3 APIC 0x3

Muudatus kajastub samuti nt systool väljundis

root@pwrk-02:~# systool -b cpu -v | grep -v ^MODA
Bus = "cpu"

  Device = "cpu0"
  Device path = "/sys/devices/system/cpu/cpu0"
    crash_notes_size    = "368"
    crash_notes         = "277c3e400"
    uevent              = "DRIVER=processor
"

  Device = "cpu1"
  Device path = "/sys/devices/system/cpu/cpu1"
    crash_notes_size    = "368"
    crash_notes         = "277cbe400"
    online              = "1"
    uevent              = "DRIVER=processor
"

  Device = "cpu2"
  Device path = "/sys/devices/system/cpu/cpu2"
    crash_notes_size    = "368"
    crash_notes         = "277d3e400"
    online              = "1"
    uevent              = "DRIVER=processor
"

  Device = "cpu3"
  Device path = "/sys/devices/system/cpu/cpu3"
    crash_notes_size    = "368"
    crash_notes         = "277dbe400"
    online              = "1"
    uevent              = "DRIVER=processor
"

kus

  • online väärtus kajastab kas cpu on sisse või välja lülitatud

Kiirus (sagedus)

Protsessori omaduste vaatlemine

root@pve-svc-02:~# turbostat
turbostat version 2022.10.04 - Len Brown <lenb@kernel.org>
Kernel command line: initrd=\EFI\proxmox\6.8.12-11-pve\initrd.img-6.8.12-11-pve root=ZFS=rpool/ROOT/pve-1 boot=zfs
CPUID(0): AuthenticAMD 0x10 CPUID levels
CPUID(1): family:model:stepping 0x19:50:0 (25:80:0) microcode 0x0
CPUID(0x80000000): max_extended_levels: 0x80000023
CPUID(1): SSE3 MONITOR - - - TSC MSR - HT -
CPUID(6): APERF, No-TURBO, No-DTS, No-PTM, No-HWP, No-HWPnotify, No-HWPwindow, No-HWPepp, No-HWPpkg, No-EPB
CPUID(7): No-SGX No-Hybrid
RAPL: 234 sec. Joule Counter Range, at 280 Watts
/dev/cpu_dma_latency: 2000000000 usec (default)
current_driver: acpi_idle
current_governor: menu
current_governor_ro: menu
cpu9: POLL: CPUIDLE CORE POLL IDLE
cpu9: C1: ACPI FFH MWAIT 0x0
cpu9: C2: ACPI IOPORT 0x414
cpu9: C3: ACPI IOPORT 0x415
cpu9: cpufreq driver: amd-pstate-epp
cpu9: cpufreq governor: powersave
cpu0: MSR_RAPL_PWR_UNIT: 0x000a1003 (0.125000 Watts, 0.000015 Joules, 0.000977 sec.)

Core	CPU    Avg_MHz	Busy%	Bzy_MHz   TSC_MHz   IPC     IRQ     POLL    C1    C2    C3      POLL%   C1%     C2%     C3%     CorWatt    PkgWatt
-       -      7        0.22	2944	  3593      0.53    2059    2       253   468   1203    0.00    0.13    0.40    99.27   0.08       4.53
0       0      7        0.23	2944      3593      0.32    269     0       22    36    191     0.00	0.30	0.39	99.09	0.02       4.53
0       6      5        0.18	2944      3593      0.35    186     1       45    24	107     0.00	0.61	0.10	99.12
1       1      8        0.26	2944      3593      0.59    163     0       7     41	108     0.00	0.01	0.57	99.17	0.01
..

5       5      2        0.08    2944      3593      0.26     84     0       3     23	57      0.00	0.02	0.09	99.82	0.00
5       11     2        0.05    2944      3593      0.56     60     0       1     24	34      0.00	0.00	0.29	99.67

..

kus

  • c-states - driveriks on 'acpi_idle' ja selle driveri governoriks on 'menu' (tegeleb sleep state'idega)
  • p-states - driveriks on 'amd-pstate-epp' ja selle draiveri governoriks on 'powersave (tegeleb protsessori sagedusega)
  • väjlundis on cpu9 ja cpu0 esitatud, aga nende kohta toodud tulemused esindevad ka teisi cpusid

ning

root@pve-svc-02:~# cpupower frequency-info
analyzing CPU 0:
  driver: amd-pstate-epp
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 400 MHz - 4.27 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 400 MHz and 3.00 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 2.94 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    Boost States: 0
    Total States: 3
    Pstate-P0:  3600MHz
    Pstate-P1:  1700MHz
    Pstate-P2:  1400MHz

Toiterežiimi muutmiseks sobib öelda

TODO

Sageduse muutmiseks sobib öelda

root@pve-svc-02:~# cpupower frequency-set --max 400MHz
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
Setting cpu: 3
Setting cpu: 4
Setting cpu: 5
Setting cpu: 6
Setting cpu: 7
Setting cpu: 8
Setting cpu: 9
Setting cpu: 10
Setting cpu: 11
Following CPUs are offline:
12-31
cpupower set operation was not performed on them

Tulemusena

root@pve-svc-02:~# cpupower frequency-info
analyzing CPU 0:
  driver: amd-pstate-epp
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 400 MHz - 4.27 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 400 MHz and 400 MHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 399 MHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    Boost States: 0
    Total States: 3
    Pstate-P0:  3600MHz
    Pstate-P1:  1700MHz
    Pstate-P2:  1400MHz

Kiirust saab kaudselt muuta governor abil

root@pve-svc-02:~# cpupower frequency-set -g performance

Muudatuse mõju hindamine

Protsessori muudatuste mõju hindamiseks sobib nt kasutada utiliiti 'openssl speed'

root@pwrk-02:~# openssl speed -multi 4 rsa

Kasulikud materjalid