# FreeBSD 11.2 on a Pi2 ignoring one cpu.



## Spoozilla (Sep 22, 2018)

I have 2 Raspberry Pi2s' running FreeBSD 11.2p2 which I have built from source (r338412). Both seem to function perfectly but I have noticed some odd load values. Despite being 98%-99% idle, the systems show load values in the region of 1.00 to 1.23. Running top with all system processes enabled shows that only CPU 0,1 and 3 are being utilised despite all 4 cores being discovered on boot (according to dmesg).  

Running a make -j8 buildworld shows 3 CPUs (0,1 and 3) running jobs and all at 99% user, but CPU 2 never gets any work and is always 100% idle.

top -S -b -n 200 at idle

```
last pid:   844;  load averages:  1.05,  1.09,  1.03  up 0+01:16:25    17:53:32
47 processes:  2 running, 44 sleeping, 1 waiting

Mem: 9524K Active, 14M Inact, 38M Wired, 5777K Buf, 732M Free
Swap:

  PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME    WCPU COMMAND
   10 root          4 155 ki31     0K    32K RUN     0 226:13 400.00% idle
   11 root         22 -56    -     0K   176K WAIT   -1   2:26   1.46% intr
   13 root          6 -68    -     0K    48K -       1   0:08   0.00% usb
  773 root          1  20    0  8996K  5468K select  0   0:03   0.00% tmux
    9 root          1 -16    -     0K     8K -       1   0:02   0.00% rand_harvestq
  592 root          1  20    0  6040K  1788K select  3   0:01   0.00% powerd
  589 root          1  20    0 11096K 11124K select  1   0:01   0.00% ntpd
   27 root          1  16    -     0K     8K syncer  0   0:00   0.00% syncer
  774 root          1  20    0  8984K  4248K pause   3   0:00   0.00% csh
  689 root          1  20    0  8984K  4220K pause   1   0:00   0.00% csh
   25 root          2 -16    -     0K    16K psleep  0   0:00   0.00% bufdaemon
   21 root          3 -16    -     0K    24K psleep  0   0:00   0.00% pagedaemon
   12 root          3  -8    -     0K    24K -       3   0:00   0.00% geom
   18 root          1 -16    -     0K     8K mmcsd   3   0:00   0.00% mmcsd0: mmc/sd card
  639 root          1  20    0  6108K  2152K nanslp  0   0:00   0.00% cron
  686 root          1  23    0  6604K  2552K wait    1   0:00   0.00% login
   26 root          1 -16    -     0K     8K vlruwt  0   0:00   0.00% vnlru
   24 root          1 -16    -     0K     8K -       0   0:00   0.00% bufspacedaemon
  771 root          1  29    0  8996K  4732K select  3   0:00   0.00% tmux
  502 root          1  20    0  6072K  2052K select  1   0:00   0.00% syslogd
    1 root          1  20    0  5268K   948K wait    0   0:00   0.00% init
  844 root          1  24    0  7404K  2568K CPU1    1   0:00   0.00% top
    0 root          9 -16    -     0K    64K swapin  3   0:00   0.00% kernel
  687 root          1  52    0  6060K  1836K ttyin   3   0:00   0.00% getty
  688 root          1  52    0  6060K  1828K ttyin   1   0:00   0.00% getty
  358 root          1  20    0  6992K  3796K select  3   0:00   0.00% devd
  345 root          1  20    0  6184K  1916K select  0   0:00   0.00% moused
  635 root          1  52    0 11068K  6052K select  1   0:00   0.00% sshd
  295 root          1  52    0  6184K  2100K select  3   0:00   0.00% dhclient
  100 root          1  52    0  5948K  1804K pause   1   0:00   0.00% adjkerntz
   16 root          1 -16    -     0K     8K -       0   0:00   0.00% soaiod3
   14 root          1 -16    -     0K     8K -       1   0:00   0.00% soaiod1
   15 root          1 -16    -     0K     8K -       0   0:00   0.00% soaiod2
   17 root          1 -16    -     0K     8K -       0   0:00   0.00% soaiod4
  340 _dhcp         1  52    0  6184K  2200K select  0   0:00   0.00% dhclient
  518 _sndio        1  52  -20  6084K  1944K select  0   0:00   0.00% sndiod
   23 root          1 155 ki31     0K     8K pgzero  1   0:00   0.00% pagezero
    8 root          1 -16    -     0K     8K waitin  1   0:00   0.00% sctp_iterator
   20 root          1 -16    -     0K     8K worker  0   0:00   0.00% bcm2835_audio_worke
    5 root          1 -16    -     0K     8K sema c  3   0:00   0.00% VCHIQ-0
   22 root          1 -16    -     0K     8K psleep  1   0:00   0.00% vmdaemon
    4 root          2 -16    -     0K    16K -       0   0:00   0.00% cam
    2 root          1 -16    -     0K     8K crypto  0   0:00   0.00% crypto
    6 root          1 -16    -     0K     8K sema c  0   0:00   0.00% VCHIQr-0
    3 root          1 -16    -     0K     8K crypto  0   0:00   0.00% crypto returns
    7 root          1 -16    -     0K     8K sema c  0   0:00   0.00% VCHIQs-0
   19 root          1 -16    -     0K     8K VCHI c  0   0:00   0.00% VCHIQka-0
```


top -S -b -n 200 with make -j8 buildworld

```
last pid:  3070;  load averages: 11.15,  7.61,  4.17  up 0+01:32:56    18:10:03
102 processes: 12 running, 88 sleeping, 1 zombie, 1 waiting

Mem: 109M Active, 72M Inact, 133M Wired, 85M Buf, 479M Free
Swap: 2048M Total, 2048M Free


  PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME    WCPU COMMAND
   10 root          4 155 ki31     0K    32K RUN     0 257:31 100.00% idle
 2856 root          1  87    0 75840K 55616K RUN     1   0:26  49.27% c++
 2988 root          1  86    0 89884K 69404K CPU1    1   0:14  44.29% c++
 3055 root          1  84    0 69792K 48148K RUN     3   0:07  42.19% c++
 2940 root          1  84    0 85900K 64744K CPU0    0   0:17  37.16% c++
 3066 root          1  74    0 63592K 42308K RUN     0   0:01   8.40% c++
   11 root         22 -56    -     0K   176K WAIT   -1   3:03   0.59% intr
 3065 root          1  52    0 61192K 40220K wait    3   0:00   0.39% c++
  773 root          1  20    0 11044K  6772K select  3   0:09   0.20% tmux
   13 root          6 -68    -     0K    48K -       3   0:10   0.00% usb
    9 root          1 -16    -     0K     8K -       3   0:03   0.00% rand_harvestq
  592 root          1  20    0  6040K  1788K select  1   0:02   0.00% powerd
  589 root          1  20    0 11096K 11124K select  1   0:01   0.00% ntpd
   12 root          3  -8    -     0K    24K -       0   0:01   0.00% geom
  862 root          1  20    0 11384K  6516K select  0   0:01   0.00% sshd
   27 root          1  16    -     0K     8K syncer  1   0:01   0.00% syncer
   25 root          4  20    -     0K    32K psleep  1   0:01   0.00% bufdaemon
    4 root          2 -16    -     0K    16K -       0   0:01   0.00% cam
  774 root          1  20    0  8984K  4268K pause   3   0:00   0.00% csh
 1153 root          1   4    0  4912K  1636K RUN     3   0:00   0.00% make
 2909 root          1  73    0 63548K 41640K RUN     1   0:00   0.00% c++
 1079 root          1   4    0  4912K  1276K select  1   0:00   0.00% make
 2409 root          1  48    0  4912K  1596K select  3   0:00   0.00% make
   21 root          3 -16    -     0K    24K psleep  1   0:00   0.00% pagedaemon
   18 root          1 -16    -     0K     8K mmcsd   3   0:00   0.00% mmcsd0: mmc/sd card
  689 root          1  20    0  8984K  4220K pause   1   0:00   0.00% csh
 2723 root          1   4    0  4912K  1420K select  1   0:00   0.00% make
 1015 root          1  20    0  8984K  4360K pause   1   0:00   0.00% csh
  938 root          1  20    0  4912K  1276K select  3   0:00   0.00% make
 2890 root          1   4    0  4912K  1392K RUN     1   0:00   0.00% make
 2973 root          1   4    0  4912K  1404K select  3   0:00   0.00% make
  914 root          1  20    0  4912K  1000K select  1   0:00   0.00% make
  865 root          1  21    0  8984K  4412K pause   3   0:00   0.00% csh
 3018 root          1   4    0  4912K  1396K RUN     0   0:00   0.00% make
  639 root          1  20    0  6108K  2152K nanslp  3   0:00   0.00% cron
 3048 root          1   4    0  4912K  1380K select  0   0:00   0.00% make
 1713 root          1  20    0  4912K  1000K select  3   0:00   0.00% make
   26 root          1 -16    -     0K     8K vlruwt  1   0:00   0.00% vnlru
   24 root          1  20    -     0K     8K -       1   0:00   0.00% bufspacedaemon
  686 root          1  23    0  6604K  2552K wait    1   0:00   0.00% login
 1711 root          1  20    0  4912K   992K select  1   0:00   0.00% make
  358 root          1  20    0  6992K  3796K select  1   0:00   0.00% devd
  502 root          1  20    0  6072K  2052K select  3   0:00   0.00% syslogd
 2508 root          1   4    0  4912K   992K select  3   0:00   0.00% make
 2594 root          1  20    0  4912K   992K select  1   0:00   0.00% make
 3054 root          1  52    0 61192K 40220K wait    0   0:00   0.00% c++
  771 root          1  29    0  8996K  4732K select  3   0:00   0.00% tmux
 2986 root          1  30    0 61192K 40220K wait    3   0:00   0.00% c++
 2854 root          1  28    0 61192K 40220K wait    1   0:00   0.00% c++
    0 root          9 -16    -     0K    64K swapin  3   0:00   0.00% kernel
 2939 root          1  45    0 61192K 40220K wait    1   0:00   0.00% c++
 2906 root          1  52    0 61192K 40220K wait    3   0:00   0.00% c++
 3068 root          1  52    0 61192K 40220K wait    3   0:00   0.00% cc
 3069 root          1  52    0 61192K 40456K RUN     1   0:00   0.00% cc
    1 root          1  20    0  5268K   948K wait    0   0:00   0.00% init
 3004 root          1   4    0  4912K   996K select  1   0:00   0.00% make
  868 root          1  20    0  8996K  4956K select  3   0:00   0.00% tmux
 3070 root          1  22    0  7404K  2616K CPU3    3   0:00   0.00% top
 2972 root          1  34    0  6580K  2264K wait    0   0:00   0.00% sh
 1100 root          1  52    0  6580K  2256K wait    1   0:00   0.00% sh
 3047 root          1  52    0  6580K  2260K wait    1   0:00   0.00% sh
 3064 root          1  43    0  6580K  2256K wait    3   0:00   0.00% sh
 3067 root          1  52    0  6580K  2244K wait    3   0:00   0.00% sh
 1712 root          1  35    0  6580K  2268K wait    0   0:00   0.00% sh
 2853 root          1  22    0  6580K  2256K wait    1   0:00   0.00% sh
  687 root          1  52    0  6060K  1836K ttyin   3   0:00   0.00% getty
 2722 root          1  52    0  6580K  2260K wait    0   0:00   0.00% sh
  635 root          1  20    0 11068K  6052K select  3   0:00   0.00% sshd
  688 root          1  52    0  6060K  1828K ttyin   1   0:00   0.00% getty
 2593 root          1  21    0  6580K  2260K wait    1   0:00   0.00% sh
 2985 root          1  24    0  6580K  2256K wait    3   0:00   0.00% sh
 1103 root          1  26    0  6580K  2256K wait    0   0:00   0.00% sh
 3017 root          1  23    0  6580K  2264K wait    3   0:00   0.00% sh
 3053 root          1  52    0  6580K  2248K wait    0   0:00   0.00% sh
 2938 root          1  39    0  6580K  2256K wait    0   0:00   0.00% sh
 2507 root          1  21    0  6580K  2264K wait    1   0:00   0.00% sh
 2905 root          1  52    0  6580K  2256K wait    0   0:00   0.00% sh
 2889 root          1  21    0  6580K  2264K wait    1   0:00   0.00% sh
 3003 root          1  22    0  6580K  2264K wait    1   0:00   0.00% sh
 2396 root          1  52    0  6580K  2256K wait    1   0:00   0.00% sh
 1078 root          1  52    0  6580K  2240K wait    1   0:00   0.00% sh
  937 root          1  52    0  6580K  2236K wait    3   0:00   0.00% sh
  295 root          1  52    0  6184K  2100K select  3   0:00   0.00% dhclient
   16 root          1 -16    -     0K     8K -       3   0:00   0.00% soaiod3
  100 root          1  52    0  5948K  1804K pause   1   0:00   0.00% adjkerntz
   14 root          1 -16    -     0K     8K -       3   0:00   0.00% soaiod1
   17 root          1 -16    -     0K     8K -       1   0:00   0.00% soaiod4
   15 root          1 -16    -     0K     8K -       3   0:00   0.00% soaiod2
  340 _dhcp         1  52    0  6184K  2200K select  0   0:00   0.00% dhclient
  898 root          1  52    0  6184K  1928K select  0   0:00   0.00% moused
  518 _sndio        1  52  -20  6084K  1944K select  0   0:00   0.00% sndiod
   23 root          1 155 ki31     0K     8K pgzero  0   0:00   0.00% pagezero
    8 root          1 -16    -     0K     8K waitin  1   0:00   0.00% sctp_iterator
   20 root          1 -16    -     0K     8K worker  0   0:00   0.00% bcm2835_audio_worke
    5 root          1 -16    -     0K     8K sema c  3   0:00   0.00% VCHIQ-0
   22 root          1 -16    -     0K     8K psleep  1   0:00   0.00% vmdaemon
    3 root          1 -16    -     0K     8K crypto  0   0:00   0.00% crypto returns
    7 root          1 -16    -     0K     8K sema c  0   0:00   0.00% VCHIQs-0
   19 root          1 -16    -     0K     8K VCHI c  0   0:00   0.00% VCHIQka-0
    6 root          1 -16    -     0K     8K sema c  0   0:00   0.00% VCHIQr-0
    2 root          1 -16    -     0K     8K crypto  0   0:00   0.00% crypto
```

dmesg

```
Copyright (c) 1992-2018 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.2-RELEASE-p2 #0 r338421: Sun Sep  2 13:00:18 BST 2018
    root@pi2-desktop:/usr/obj/usr/src/sys/RPI2 arm
FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0)
VT: init without driver.
CPU: ARM Cortex-A7 r0p5 (ECO: 0x00000000)
CPU Features:
  Multiprocessing, Thumb2, Security, Virtualization, Generic Timer, VMSAv7,
  PXN, LPAE, Coherent Walk
Optional instructions:
  SDIV/UDIV, UMULL, SMULL, SIMD(ext)
LoUU:2 LoC:3 LoUIS:2
Cache level 1:
 32KB/64B 4-way data cache WB Read-Alloc Write-Alloc
 32KB/32B 2-way instruction cache Read-Alloc
Cache level 2:
 512KB/64B 8-way unified cache WB Read-Alloc Write-Alloc
real memory  = 994045952 (947 MB)
avail memory = 829575168 (791 MB)
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
random: entropy device external interface
kbd0 at kbdmux0
ofwbus0: <Open Firmware Device Tree>
simplebus0: <Flattened device tree simple bus> mem 0x3f000000-0x3fffffff on ofwbus0
local_intc0: <BCM2836 Interrupt Controller> mem 0x40000000-0x400000ff on simplebus0
intc0: <BCM2835 Interrupt Controller> mem 0xb200-0xb3ff irq 4 on simplebus0
generic_timer0: <ARMv7 Generic Timer> irq 0,1,2,3 on ofwbus0
Timecounter "ARM MPCore Timecounter" frequency 19200000 Hz quality 1000
Event timer "ARM MPCore Eventtimer" frequency 19200000 Hz quality 1000
bcmwd0: <BCM2708/2835 Watchdog> mem 0x10001c-0x100027 on simplebus0
gpio0: <BCM2708/2835 GPIO controller> mem 0x200000-0x2000af irq 5,6,7,8 on simplebus0
gpio0: read-only pins: 46,48-53.
gpio0: reserved pins: 48-53.
gpiobus0: <OFW GPIO bus> on gpio0
gpioc0: <GPIO controller> on gpio0
bcmrng0: <Broadcom BCM2835 RNG> mem 0x104000-0x10401f irq 9 on simplebus0
iichb0: <BCM2708/2835 BSC controller> mem 0x205000-0x20501f irq 10 on simplebus0
iichb1: <BCM2708/2835 BSC controller> mem 0x804000-0x80401f irq 11 on simplebus0
spi0: <BCM2708/2835 SPI controller> mem 0x204000-0x20401f irq 12 on simplebus0
spibus0: <OFW SPI bus> on spi0
bcm_dma0: <BCM2835 DMA Controller> mem 0x7000-0x7fff,0xe05000-0xe05fff irq 13,14,15,16,17,18,19,20,21,22,23,24,25 on simplebus0
mbox0: <BCM2835 VideoCore Mailbox> mem 0xb880-0xb8bf irq 26 on simplebus0
sdhci_bcm0: <Broadcom 2708 SDHCI controller> mem 0x300000-0x3000ff irq 27 on simplebus0
mmc0: <MMC/SD bus> on sdhci_bcm0
uart0: <PrimeCell UART (PL011)> mem 0x201000-0x201fff irq 28 on simplebus0
uart0: console (115200,n,8,1)
vchiq0: <BCM2835 VCHIQ> mem 0xb800-0xb84f irq 29 on simplebus0
vchiq: local ver 8 (min 3), remote ver 8.
pcm0: <VCHIQ audio> on vchiq0
bcm283x_dwcotg0: <DWC OTG 2.0 integrated USB controller (bcm283x)> mem 0x980000-0x99ffff irq 30 on simplebus0
usbus0 on bcm283x_dwcotg0
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
bcm2835_cpufreq0: <CPU Frequency Control> on cpu0
cpu1: <Open Firmware CPU> on cpulist0
cpu2: <Open Firmware CPU> on cpulist0
cpu3: <Open Firmware CPU> on cpulist0
fb0: <BCM2835 VT framebuffer driver> on ofwbus0
fbd0 on fb0
VT: initialize with new VT driver "fb".
fb0: 1680x1050(1680x1050@0,0) 24bpp
fb0: fbswap: 0, pitch 5040, base 0x3e6e7000, screen_size 5322240
gpioled0: <GPIO LEDs> on ofwbus0
cryptosoft0: <software crypto>
Timecounters tick every 1.000 msec
iicbus0: <OFW I2C bus> on iichb0
iic0: <I2C generic I/O> on iicbus0
iicbus1: <OFW I2C bus> on iichb1
iic1: <I2C generic I/O> on iicbus1
usbus0: 480Mbps High Speed USB v2.0
ugen0.1: <DWCOTG OTG Root HUB> at usbus0
uhub0: <DWCOTG OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
uhub0: 1 port with 1 removable, self powered
mmcsd0: 16GB <SDHC NCard 0.2 SN 208458BE MFG 04/2015 by 131 NC> at mmc0 50.0MHz/4bit/65535-block
bcm2835_cpufreq0: ARM 300MHz, Core 250MHz, SDRAM 400MHz, Turbo OFF
Release APs
Trying to mount root from ufs:/dev/ufs/rootfs [rw]...
Warning: no time-of-day clock registered, system time will not be set accurately
ugen0.2: <vendor 0x0424 product 0x9514> at usbus0
uhub1: <vendor 0x0424 product 0x9514, class 9/0, rev 2.00/2.00, addr 2> on usbus0
uhub1: MTT enabled
uhub1: 5 ports with 4 removable, self powered
random: unblocking device.
local_intc0: Spurious interrupt detected
ugen0.3: <vendor 0x0424 product 0xec00> at usbus0
smsc0 on uhub1
smsc0: <vendor 0x0424 product 0xec00, rev 2.00/2.00, addr 3> on usbus0
smsc0: chip 0xec00, rev. 0002
miibus0: <MII bus> on smsc0
ukphy0: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ue0: <USB Ethernet> on smsc0
ue0: Ethernet address: b8:27:eb:42:e9:7d
ugen0.4: <Microsoft Microsoft IntelliMouse Optical> at usbus0
smsc0: chip 0xec00, rev. 0002
ue0: link state changed to DOWN
ugen0.5: <vendor 0x046a product 0x0001> at usbus0
ukbd0 on uhub1
ukbd0: <vendor 0x046a product 0x0001, class 0/0, rev 1.10/9.09, addr 5> on usbus0
kbd1 at ukbd0
ue0: link state changed to UP
ums0 on uhub1
ums0: <Microsoft Microsoft IntelliMouse Optical, class 0/0, rev 1.10/1.08, addr 4> on usbus0
ums0: 5 buttons and [XYZ] coordinates ID=0
```

I have no idea how to proceed with this issue. Any advice would be greatly received.


----------

