On 31.7.2022. 5:13, Scott Cheloha wrote: > Hi, > > At the urging of sthen@ and dv@, here is v5. > > Two major changes from v4: > > - Add the function tc_reset_quality() to kern_tc.c and use it > to lower the quality of the TSC timecounter if we fail the > sync test. > > tc_reset_quality() will choose a new active timecounter if, > after the quality change, the given timecounter is no longer > the best timecounter. > > The upshot is: if you fail the TSC sync test you should boot > with the HPET as your active timecounter. If you don't have > an HPET you'll be using something else. > > - Drop the SMT accomodation from the hot loop. It hasn't been > necessary since last year when I rewrote the test to run without > a mutex. In the rewritten test, the two CPUs in the hot loop > are not competing for any resources so they should not be able > to starve one another. > > dv: Could you double-check that this still chooses the right > timecounter on your machine? If so, I will ask deraadt@ to > put this into snaps to replace v4. > > Additional test reports are welcome. Include your dmesg.
Hi, this is report from Lenovo ThinPad E14 gen2 with 6 x AMD Ryzen 5 4500U e14gen2# sysctl | grep kern.timecounter kern.timecounter.tick=1 kern.timecounter.timestepwarnings=0 kern.timecounter.hardware=acpihpet0 kern.timecounter.choice=i8254(0) tsc(-1000) acpihpet0(1000) acpitimer0(1000) OpenBSD 7.2-beta (GENERIC.MP) #20: Tue Aug 2 23:13:28 CEST 2022 hrv...@e14gen2.srce.hr:/sys/arch/amd64/compile/GENERIC.MP real mem = 7713394688 (7356MB) avail mem = 7462240256 (7116MB) random: good seed from bootblocks mpath0 at root scsibus0 at mpath0: 256 targets mainbus0 at root bios0 at mainbus0: SMBIOS rev. 3.2 @ 0xbf912000 (63 entries) bios0: vendor LENOVO version "R1AET42W (1.18 )" date 03/03/2022 bios0: LENOVO 20T6000TSC acpi0 at bios0: ACPI 6.3 acpi0: sleep states S0 S3 S4 S5 acpi0: tables DSDT FACP SSDT SSDT IVRS SSDT SSDT TPM2 SSDT MSDM BATB HPET APIC MCFG SBST WSMT VFCT SSDT CRAT CDIT FPDT SSDT SSDT SSDT BGRT UEFI SSDT SSDT acpi0: wakeup devices GPP3(S3) GPP4(S4) GPP5(S3) XHC0(S3) XHC1(S3) GP19(S3) LID_(S4) SLPB(S3) acpitimer0 at acpi0: 3579545 Hz, 32 bits acpihpet0 at acpi0: 14318180 Hz acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat cpu0 at mainbus0: apid 0 (boot processor) cpu0: AMD Ryzen 5 4500U with Radeon Graphics, 2370.90 MHz, 17-60-01 cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,TCE,TOPEXT,CPCTR,DBKP,PCTRL3,MWAITX,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,PQM,RDSEED,ADX,SMAP,CLFLUSHOPT,CLWB,SHA,UMIP,IBPB,IBRS,STIBP,SSBD,XSAVEOPT,XSAVEC,XGETBV1,XSAVES cpu0: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 512KB 64b/line 8-way L2 cache, 4MB 64b/line 16-way L3 cache cpu0: smt 0, core 0, package 0 mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges cpu0: apic clock running at 99MHz cpu0: mwait min=64, max=64, C-substates=1.1, IBE cpu1 at mainbus0: apid 1 (application processor) cpu1: AMD Ryzen 5 4500U with Radeon Graphics, 2370.55 MHz, 17-60-01 cpu1: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,TCE,TOPEXT,CPCTR,DBKP,PCTRL3,MWAITX,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,PQM,RDSEED,ADX,SMAP,CLFLUSHOPT,CLWB,SHA,UMIP,IBPB,IBRS,STIBP,SSBD,XSAVEOPT,XSAVEC,XGETBV1,XSAVES cpu1: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 512KB 64b/line 8-way L2 cache, 4MB 64b/line 16-way L3 cache cpu1: smt 0, core 1, package 0 cpu2 at mainbus0: apid 2 (application processor) cpu2: AMD Ryzen 5 4500U with Radeon Graphics, 2370.55 MHz, 17-60-01 cpu2: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,TCE,TOPEXT,CPCTR,DBKP,PCTRL3,MWAITX,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,PQM,RDSEED,ADX,SMAP,CLFLUSHOPT,CLWB,SHA,UMIP,IBPB,IBRS,STIBP,SSBD,XSAVEOPT,XSAVEC,XGETBV1,XSAVES cpu2: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 512KB 64b/line 8-way L2 cache, 4MB 64b/line 16-way L3 cache cpu2: smt 0, core 2, package 0 cpu3 at mainbus0: apid 4 (application processor) tsc: cpu0/cpu3: sync test round 1/2 failed tsc: cpu0/cpu3: cpu3: 51485 lags 5130 cycles cpu3: AMD Ryzen 5 4500U with Radeon Graphics, 2370.55 MHz, 17-60-01 cpu3: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,TCE,TOPEXT,CPCTR,DBKP,PCTRL3,MWAITX,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,PQM,RDSEED,ADX,SMAP,CLFLUSHOPT,CLWB,SHA,UMIP,IBPB,IBRS,STIBP,SSBD,XSAVEOPT,XSAVEC,XGETBV1,XSAVES cpu3: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 512KB 64b/line 8-way L2 cache, 4MB 64b/line 16-way L3 cache cpu3: smt 0, core 4, package 0 cpu4 at mainbus0: apid 5 (application processor) tsc: cpu0/cpu4: sync test round 1/2 failed tsc: cpu0/cpu4: cpu4: 52106 lags 4750 cycles cpu4: AMD Ryzen 5 4500U with Radeon Graphics, 2370.55 MHz, 17-60-01 cpu4: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,TCE,TOPEXT,CPCTR,DBKP,PCTRL3,MWAITX,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,PQM,RDSEED,ADX,SMAP,CLFLUSHOPT,CLWB,SHA,UMIP,IBPB,IBRS,STIBP,SSBD,XSAVEOPT,XSAVEC,XGETBV1,XSAVES cpu4: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 512KB 64b/line 8-way L2 cache, 4MB 64b/line 16-way L3 cache cpu4: smt 0, core 5, package 0 cpu5 at mainbus0: apid 6 (application processor) tsc: cpu0/cpu5: sync test round 1/2 failed tsc: cpu0/cpu5: cpu5: 52093 lags 5106 cycles cpu5: AMD Ryzen 5 4500U with Radeon Graphics, 2370.55 MHz, 17-60-01 cpu5: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,TCE,TOPEXT,CPCTR,DBKP,PCTRL3,MWAITX,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,PQM,RDSEED,ADX,SMAP,CLFLUSHOPT,CLWB,SHA,UMIP,IBPB,IBRS,STIBP,SSBD,XSAVEOPT,XSAVEC,XGETBV1,XSAVES cpu5: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 512KB 64b/line 8-way L2 cache, 4MB 64b/line 16-way L3 cache cpu5: smt 0, core 6, package 0 ioapic0 at mainbus0: apid 32 pa 0xfec00000, version 21, 24 pins, can't remap ioapic1 at mainbus0: apid 33 pa 0xfec01000, version 21, 32 pins, can't remap acpimcfg0 at acpi0 acpimcfg0: addr 0xf8000000, bus 0-63 acpiprt0 at acpi0: bus 0 (PCI0) acpiprt1 at acpi0: bus 1 (GPP3) acpiprt2 at acpi0: bus 2 (GPP4) acpiprt3 at acpi0: bus 3 (GPP5) acpiprt4 at acpi0: bus 4 (GPP6) acpiprt5 at acpi0: bus 5 (GP17) acpiprt6 at acpi0: bus -1 (GP18) acpiprt7 at acpi0: bus -1 (GP19) acpiec0 at acpi0 "ACPI0010" at acpi0 not configured acpicpu0 at acpi0: C3(0@350 io@0x415), C2(0@400 io@0x414), C1(0@1 mwait), PSS acpicpu1 at acpi0: C3(0@350 io@0x415), C2(0@400 io@0x414), C1(0@1 mwait), PSS acpicpu2 at acpi0: C3(0@350 io@0x415), C2(0@400 io@0x414), C1(0@1 mwait), PSS acpicpu3 at acpi0: C3(0@350 io@0x415), C2(0@400 io@0x414), C1(0@1 mwait), PSS acpicpu4 at acpi0: C3(0@350 io@0x415), C2(0@400 io@0x414), C1(0@1 mwait), PSS acpicpu5 at acpi0: C3(0@350 io@0x415), C2(0@400 io@0x414), C1(0@1 mwait), PSS acpicpu6 at acpi0: no cpu matching ACPI ID 6 acpicpu7 at acpi0: no cpu matching ACPI ID 7 acpicpu8 at acpi0: no cpu matching ACPI ID 8 acpicpu9 at acpi0: no cpu matching ACPI ID 9 acpicpu10 at acpi0: no cpu matching ACPI ID 10 acpicpu11 at acpi0: no cpu matching ACPI ID 11 acpicpu12 at acpi0: no cpu matching ACPI ID 12 acpicpu13 at acpi0: no cpu matching ACPI ID 13 acpicpu14 at acpi0: no cpu matching ACPI ID 14 acpicpu15 at acpi0: no cpu matching ACPI ID 15 acpibtn0 at acpi0: PWRB acpipci0 at acpi0 PCI0: 0x00000010 0x00000011 0x00000000 acpicmos0 at acpi0 acpibat0 at acpi0: BAT0 model "5B10X026" serial 1489 type LiP oem "SMP" acpiac0 at acpi0: AC unit offline acpithinkpad0 at acpi0: version 2.0 "LEN0130" at acpi0 not configured "LEN0100" at acpi0 not configured "SMB0001" at acpi0 not configured acpibtn1 at acpi0: LID_ acpibtn2 at acpi0: SLPB "PNP0C14" at acpi0 not configured "PNP0C14" at acpi0 not configured "PNP0C14" at acpi0 not configured "PNP0C14" at acpi0 not configured "PNP0C14" at acpi0 not configured amdgpio0 at acpi0 GPIO uid 0 addr 0xfed81500/0x400 irq 9, 184 pins "USBC000" at acpi0 not configured tpm0 at acpi0 TPM_ 2.0 (TIS) addr 0xfed40000/0x5000, device 0x0000104a rev 0x4e "PNP0C14" at acpi0 not configured acpipwrres0 at acpi0: WRST acpipwrres1 at acpi0: DRST acpipwrres2 at acpi0: P0S0, resource for SATA acpipwrres3 at acpi0: P3S0, resource for SATA acpipwrres4 at acpi0: P0S1, resource for SAT1 acpipwrres5 at acpi0: P3S1, resource for SAT1 acpivideo0 at acpi0: VGA_ acpivout0 at acpivideo0: LCD_ cpu0: 2370 MHz: speeds: 2375 1700 1400 MHz pci0 at mainbus0 bus 0 ksmn0 at pci0 dev 0 function 0 "AMD 17h/6xh Root Complex" rev 0x00 "AMD 17h/6xh IOMMU" rev 0x00 at pci0 dev 0 function 2 not configured pchb0 at pci0 dev 1 function 0 "AMD 17h/6xh Host" rev 0x00 pchb1 at pci0 dev 2 function 0 "AMD 17h/6xh Host" rev 0x00 ppb0 at pci0 dev 2 function 1 "AMD 17h/6xh PCIE" rev 0x00: msi pci1 at ppb0 bus 1 nvme0 at pci1 dev 0 function 0 "SanDisk PC SN530" rev 0x01: msix, NVMe 1.4 nvme0: WDC PC SN530 SDBPMPZ-256G-1001, firmware 21160001, serial 203857804454 scsibus1 at nvme0: 2 targets, initiator 0 sd0 at scsibus1 targ 1 lun 0: <NVMe, WDC PC SN530 SDB, 2116> sd0: 244198MB, 512 bytes/sector, 500118192 sectors ppb1 at pci0 dev 2 function 2 "AMD 17h/6xh PCIE" rev 0x00: msi pci2 at ppb1 bus 2 re0 at pci2 dev 0 function 0 "Realtek 8168" rev 0x10: RTL8168GU/8111GU (0x5080), msi, address 8c:8c:aa:1a:b2:35 rgephy0 at re0 phy 7: RTL8251 PHY, rev. 0 ppb2 at pci0 dev 2 function 3 "AMD 17h/6xh PCIE" rev 0x00: msi pci3 at ppb2 bus 3 iwx0 at pci3 dev 0 function 0 "Intel Wi-Fi 6 AX200" rev 0x1a, msix ppb3 at pci0 dev 2 function 4 "AMD 17h/6xh PCIE" rev 0x00: msi pci4 at ppb3 bus 4 nvme1 at pci4 dev 0 function 0 "Samsung SM961/PM961 NVMe" rev 0x00: msix, NVMe 1.2 nvme1: SAMSUNG MZVLW256HEHP-00000, firmware CXB7401Q, serial S33VNX0J313980 scsibus2 at nvme1: 2 targets, initiator 0 sd1 at scsibus2 targ 1 lun 0: <NVMe, SAMSUNG MZVLW256, CXB7> sd1: 244198MB, 512 bytes/sector, 500118192 sectors pchb2 at pci0 dev 8 function 0 "AMD 17h/6xh Host" rev 0x00 ppb4 at pci0 dev 8 function 1 "AMD 17h/6xh PCIE" rev 0x00 pci5 at ppb4 bus 5 amdgpu0 at pci5 dev 0 function 0 "ATI Renoir" rev 0xc3 drm0 at amdgpu0 amdgpu0: msi azalia0 at pci5 dev 0 function 1 "ATI Renoir HD Audio" rev 0x00: msi azalia0: no supported codecs ccp0 at pci5 dev 0 function 2 "AMD 17h/1xh Crypto" rev 0x00 xhci0 at pci5 dev 0 function 3 "AMD 17h/6xh xHCI" rev 0x00: msi, xHCI 1.10 usb0 at xhci0: USB revision 3.0 uhub0 at usb0 configuration 1 interface 0 "AMD xHCI root hub" rev 3.00/1.00 addr 1 xhci1 at pci5 dev 0 function 4 "AMD 17h/6xh xHCI" rev 0x00: msi, xHCI 1.10 usb1 at xhci1: USB revision 3.0 uhub1 at usb1 configuration 1 interface 0 "AMD xHCI root hub" rev 3.00/1.00 addr 1 "AMD 17h/1xh I2S Audio" rev 0x01 at pci5 dev 0 function 5 not configured azalia1 at pci5 dev 0 function 6 "AMD 17h/1xh HD Audio" rev 0x00: apic 33 int 12 azalia1: codecs: Realtek ALC257 audio0 at azalia1 piixpm0 at pci0 dev 20 function 0 "AMD FCH SMBus" rev 0x51: SMI iic0 at piixpm0 iic1 at piixpm0 pcib0 at pci0 dev 20 function 3 "AMD FCH LPC" rev 0x51 pchb3 at pci0 dev 24 function 0 "AMD 17h/6xh Data Fabric" rev 0x00 pchb4 at pci0 dev 24 function 1 "AMD 17h/6xh Data Fabric" rev 0x00 pchb5 at pci0 dev 24 function 2 "AMD 17h/6xh Data Fabric" rev 0x00 pchb6 at pci0 dev 24 function 3 "AMD 17h/6xh Data Fabric" rev 0x00 pchb7 at pci0 dev 24 function 4 "AMD 17h/6xh Data Fabric" rev 0x00 pchb8 at pci0 dev 24 function 5 "AMD 17h/6xh Data Fabric" rev 0x00 pchb9 at pci0 dev 24 function 6 "AMD 17h/6xh Data Fabric" rev 0x00 pchb10 at pci0 dev 24 function 7 "AMD 17h/6xh Data Fabric" rev 0x00 isa0 at pcib0 isadma0 at isa0 pckbc0 at isa0 port 0x60/5 irq 1 irq 12 pckbd0 at pckbc0 (kbd slot) wskbd0 at pckbd0: console keyboard pms0 at pckbc0 (aux slot) wsmouse0 at pms0 mux 0 pms0: Elantech Clickpad, version 4, firmware 0x5f3001 wsmouse1 at pms0 mux 0 pcppi0 at isa0 port 0x61 spkr0 at pcppi0 wbsio0 at isa0 port 0x4e/2: W83627THF rev 0x27 vmm0 at mainbus0: SVM/RVI efifb at mainbus0 not configured uhidev0 at uhub0 port 2 configuration 1 interface 0 "Logitech USB-PS/2 Optical Mouse" rev 2.00/11.10 addr 2 uhidev0: iclass 3/1 ums0 at uhidev0: 3 buttons, Z dir wsmouse2 at ums0 mux 0 uvideo0 at uhub0 port 3 configuration 1 interface 0 "Azurewave Integrated Camera" rev 2.01/20.01 addr 3 video0 at uvideo0 uvideo1 at uhub0 port 3 configuration 1 interface 2 "Azurewave Integrated Camera" rev 2.01/20.01 addr 3 video1 at uvideo1 ugen0 at uhub0 port 3 configuration 1 "Azurewave Integrated Camera" rev 2.01/20.01 addr 3 ugen1 at uhub1 port 3 "Generic Goodix FingerPrint Device" rev 2.00/1.00 addr 2 ugen2 at uhub1 port 4 "Intel Bluetooth" rev 2.01/0.01 addr 3 vscsi0 at root scsibus3 at vscsi0: 256 targets softraid0 at root scsibus4 at softraid0: 256 targets root on sd1a (a63e224a4913aad2.a) swap on sd1b dump on sd1b iwx0: hw rev 0x340, fw 67.8f59b80b.0, address b0:7d:64:1e:60:e0 amdgpu0: RENOIR 6 CU rev 0x00 amdgpu0: 1920x1080, 32bpp wsdisplay0 at amdgpu0 mux 1: console (std, vt100 emulation), using wskbd0 wsdisplay0: screen 1-5 added (std, vt100 emulation)