Re: 2012 Mac Mini shows ~45% intr in CPU thread 0

2019-05-10 Thread Brent Cook
On Wed, May 8, 2019 at 2:55 PM Solene Rapenne  wrote:

> On Wed, May 08, 2019 at 02:22:32PM -0400, Brent Cook wrote:
> > I have been poking at this with a similar 2011 Mac Mini. It seems to be
> > caused by the sdhc/sdmmc device:
> >
> > sdhc0 at pci9 dev 0 function 1 "Broadcom SD Host Controller" rev 0x10:
> apic
> > 2 int 17
> > sdhc0: SDHC 3.0, 200 MHz base clock
> > sdmmc0 at sdhc0: 8-bit, sd high-speed, mmc high-speed, dma
> >
> > There doesn't seem to be a recorded interrupt stat in vmstat that
> accounts
> > for it, but I found that disabling sdmmc/sdhc in ukc frees up the CPU. I
> am
> > poking at the interrupt handler to see which status is triggered when, if
> > that ends up being the root problem (have a hunch on the insert/remove
> > event never stopping).
> >
> > On Wed, Jul 4, 2018 at 2:52 AM  wrote:
> >
> > > >Synopsis:  2012 Mac Mini shows ~50% intr in CPU thread 0
> > > >Category:  system
> > > >Environment:
> > > System  : OpenBSD 6.3
> > > Details : OpenBSD 6.3-current (GENERIC.MP) #83: Mon Jul  2
> > > 10:36:36 MDT 2018
> > >  dera...@amd64.openbsd.org:
> > > /usr/src/sys/arch/amd64/compile/GENERIC.MP
> > >
> > > Architecture: OpenBSD.amd64
> > > Machine : amd64
>
> You reply to a 9 months old bug report using a now obsolete release,
> about a problem you see on another arch, without sending even a dmesg
> output.
>

Thanks for the tip!

The bug appears to have been that the BCM4331 Wireless adapter was left
enabled by the Mac EFI, which continued to send interrupts after
transferring control to OpenBSD. The fix is committed and should be in
snapshots soon. The revised dmesg should look like this to indicate that we
are disabling the device (adding a full driver for it would probably not be
worth the time for such an old chip).

Let me know how this works for you, or I can send you a diff.

OpenBSD 6.5-current (GENERIC.MP) #21: Fri May 10 11:28:59 CDT 2019
bc...@santo.lan:/sys/arch/amd64/compile/GENERIC.MP
real mem = 17069981696 (16279MB)
avail mem = 16542547968 (15776MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0x8ad34000 (81 entries)
bios0: vendor Apple Inc. version "MM51.88Z.0080.B00.1804091930" date
04/09/2018
bios0: Apple Inc. Macmini5,3
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP HPET APIC SBST ECDT SSDT SSDT SSDT SSDT SSDT SSDT
SSDT SSDT SSDT SSDT SSDT MCFG
acpi0: wakeup devices P0P2(S4) GFX0(S4) PEG1(S4) EC__(S4) GMUX(S3) HDEF(S4)
GIGE(S4) SDXC(S3) RP01(S4) ARPT(S4) RP02(S4) RP03(S4) EHC1(S3) EHC2(S3)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz, 1995.75 MHz, 06-2a-07
cpu0:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,AES,XSAVE,AVX,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,MELTDOWN
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 99MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.1.2, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz, 1995.47 MHz, 06-2a-07
cpu1:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,AES,XSAVE,AVX,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,MELTDOWN
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 4 (application processor)
cpu2: Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz, 1995.47 MHz, 06-2a-07
cpu2:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,AES,XSAVE,AVX,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,MELTDOWN
cpu2: 256KB 64b/line 8-way L2 cache
cpu2: smt 0, core 2, package 0
cpu3 at mainbus0: apid 6 (application processor)
cpu3: Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz, 1995.47 MHz, 06-2a-07
cpu3:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,AES,XSAVE,AVX,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,MELTDOWN
cpu3: 256KB 64b/line 8-way L2 cache
cpu3: smt 0, core 3, package 0
cpu4 

2012 Mac Mini shows ~45% intr in CPU thread 0

2018-07-04 Thread pjp
>Synopsis:  2012 Mac Mini shows ~50% intr in CPU thread 0
>Category:  system
>Environment:
System  : OpenBSD 6.3
Details : OpenBSD 6.3-current (GENERIC.MP) #83: Mon Jul  2 10:36:36 
MDT 2018
 
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP

Architecture: OpenBSD.amd64
Machine : amd64
>Description:
A top output:
load averages:  0.06,  0.01,  0.00   earth.centroid.eu 08:43:19
44 processes: 43 idle, 1 on processor  up 13:05
CPU0:  0.0% user,  0.0% nice,  0.0% sys,  0.2% spin, 43.8% intr, 56.0% idle
CPU1:  0.0% user,  0.0% nice,  0.1% sys,  0.0% spin,  0.0% intr, 99.9% idle
CPU2:  0.0% user,  0.0% nice,  0.1% sys,  0.0% spin,  0.0% intr, 99.9% idle
CPU3:  0.0% user,  0.0% nice,  0.0% sys,  0.0% spin,  0.0% intr,  100% idle
CPU4:  0.0% user,  0.0% nice,  0.0% sys,  0.0% spin,  0.0% intr,  100% idle
CPU5:  0.0% user,  0.0% nice,  0.0% sys,  0.0% spin,  0.0% intr,  100% idle
CPU6:  0.0% user,  0.0% nice,  0.0% sys,  0.0% spin,  0.0% intr,  100% idle
CPU7:  0.0% user,  0.0% nice,  0.0% sys,  0.0% spin,  0.0% intr,  100% idle
Memory: Real: 71M/649M act/tot Free: 15G Cache: 443M Swap: 0K/16G

I have tried the following:
1) turn off pf, no change
2) turn off sndiod, no change (this mac mini is a sound server)
3) turn off all sorts of daemons, no change
4) turned off X11 and turned off inteldrm, no change

A vmstat -i output looks like this:

interrupt   total rate
irq0/clock   37889382  799
irq0/ipi   2045464
irq144/acpi010
irq145/inteldrm0385290
irq102/xhci0 95540
irq103/ehci0   230
irq176/azalia0 3573127
irq114/bge0519009   10
irq108/ehci1  2050
irq109/ahci0880771
Total39106638  825

Have you seen this?  Is it just my computer?  

Here is one more fact on this computer:

dual boots with refind between mac os high sierra and openbsd-current.

>How-To-Repeat:
unknown.
>Fix:
unknown.


dmesg:
OpenBSD 6.3-current (GENERIC.MP) #83: Mon Jul  2 10:36:36 MDT 2018
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 17063546880 (16273MB)
avail mem = 16537944064 (15771MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0x8ad12000 (83 entries)
bios0: vendor Apple Inc. version "MM61.88Z.010E.B00.180436" date 04/11/2018
bios0: Apple Inc. Macmini6,2
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP HPET APIC SBST ECDT SSDT SSDT SSDT SSDT SSDT SSDT SSDT 
SSDT SSDT SSDT SSDT SSDT DMAR MCFG
acpi0: wakeup devices P0P2(S3) EC__(S3) GMUX(S3) HDEF(S3) RP01(S3) GIGE(S3) 
SDXC(S3) RP02(S3) ARPT(S3) RP03(S3) EHC1(S3) EHC2(S3) XHC1(S3)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz, 2295.12 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS,IBRS,IBPB,STIBP,SENSOR,ARAT,XSAVEOPT,MELTDOWN
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 99MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.1.2, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz, 2294.79 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS,IBRS,IBPB,STIBP,SENSOR,ARAT,XSAVEOPT,MELTDOWN
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 4 (application processor)
cpu2: Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz, 2294.79 MHz
cpu2: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS,IBRS,IBPB,STIBP,SENSOR,ARAT,XSAVEOPT,MELTDOWN
cpu2: 256KB 64b/line 8-way L2 cache
cpu2: smt 0, core 2, package 0
cpu3 at mainbus0: apid 6 (application processor)
cpu3: Intel(R) Core(TM) i7-3615QM CPU @