FreeBSD poor performance on Raspberry Pi 3 Model B - can you help me investigate?

Hi all,

I'd like some support/steer on how to investigate what appears to be poor performance of FreeBSD on my Raspberry Pi 3 Model B. I've been running Arch ARM on this Pi for the best part of 10-years without performance issues the likes of which I'm experiencing now (n.b. the reason I'm now attempting FreeBSD is for learning purposes of *BSD and what I understand to be an even more unix-like environment than GNU/Linux can be).

I've installed FreeBSD twice now, the second time as an attempt to sense-check if I'd made some install mistake on the first, causing the poor performance. The most recent install was using FreeBSD 14.3 arm64 aarch RPI image. This was written to the RasPi MicroSD card that had the GPT partition scheme:

Code:
FreeBSD-14.3-RELEASE-arm64-aarch64-RPI.img

Following the OS install, I've done little more than run through a few settings on bsdconfig (hostname, root password, add user), and install packages. I'm running largely without display output via ssh on my local home network.

The issue:
  • Package download/extract/installation, startup time, and overall system performance feels incredibly slow (packages of less than 10MB can take around 30-mins to fully download/extract/install)
  • There's an overall system lag that I hadn't experienced previously running this hardware with a GNU/Linux OS
I've captured the output of a few diagnostics/system queries to see if this gives any insight - if anyone has any steer from what I've pasted here, or if there's anything else you would recommend I attempt to investigate this further, any support is very much appreciated. Thanks!

Some outputs:

Output of: vmstat -s

Code:
46574424 cpu context switches
1254953436 device interrupts
      241 software interrupts
     8528 traps
  5371182 system calls
       18 kernel threads created
     2663  fork() calls
      810 vfork() calls
       24 rfork() calls
        0 swap pager pageins
        0 swap pager pages paged in
        0 swap pager pageouts
        0 swap pager pages paged out
     1345 vnode pager pageins
     9911 vnode pager pages paged in
        0 vnode pager pageouts
        0 vnode pager pages paged out
        0 page daemon wakeups
   119249 pages examined by the page daemon
        0 clean page reclamation shortfalls
        0 pages reactivated by the page daemon
   157649 copy-on-write faults
      341 copy-on-write optimized faults
   374096 zero fill pages zeroed
        0 zero fill pages prezeroed
     2273 intransit blocking page faults
  1369263 total VM faults taken
     1128 page faults requiring I/O
        0 pages affected by kernel thread creation
    97352 pages affected by  fork()
    28349 pages affected by vfork()
      842 pages affected by rfork()
   771905 pages freed
        0 pages freed by daemon
   507740 pages freed by exiting processes
     1571 pages active
   142349 pages inactive
        0 pages in the laundry queue
    53082 pages wired down
        0 virtual user pages wired down
    35117 pages free
     4096 bytes per page
   862748 total name lookups
          cache hits (88% pos + 3% neg) system 0% per-directory
          deletions 0%, falsehits 0%, toolong 0%

Output of: vmstat 5

Code:
 procs    memory    page                      disks  faults       cpu
 r  b  w  avm  fre  flt  re  pi  po   fr   sr mmc0   in   sy   cs us sy id
 0  0  0 500M 138M   18   0   0   0   10    2    0  17k   72  634  0  0 99
 0  0  0 500M 138M   14   0   0   0    0    3    0  17k  259  814  0  0 99
 0  0  0 500M 138M   11   0   0   0    2    2    2  17k   48 1.1k  0  0 99
 0  0  0 500M 138M   11   0   0   0    0    2    0  18k   53  568  0  0 99
 0  0  0 500M 138M   14   0   0   0    0    3    0  18k   59  526  0  0 99
 0  0  0 500M 138M   11   0   0   0    0    2    0  18k   48  526  0  0 99
 0  0  0 500M 138M   11   0   0   0    0    3    0  18k   48  510  0  0 99

A view of the output of top

Code:
USER   PID  %CPU %MEM   VSZ   RSS TT  STAT STARTED       TIME COMMAND
root    11 398.1  0.0     0    64  -  RNL  23:24   4835:13.78 [idle]
usera 3377   0.2  1.1 22612 10608  -  S    19:29      0:01.01 sshd-session: usera@pts/0 (sshd-session)
usera 1275   0.1  0.5 17444  4612  1  S+   23:35      6:10.02 htop
root     0   0.0  0.1     0   608  -  DLs  23:24      0:01.08 [kernel]
root     1   0.0  0.1 11644  1076  -  ILs  23:24      0:00.04 /sbin/init
root     2   0.0  0.0     0    64  -  WL   23:24      0:41.36 [clock]
root     3   0.0  0.0     0    80  -  DL   23:24      0:00.00 [crypto]
root     4   0.0  0.0     0    48  -  DL   23:24      0:00.00 [cam]
root     5   0.0  0.0     0    16  -  DL   23:24      0:00.00 [busdma]
root     6   0.0  0.0     0    16  -  DL   23:24      0:03.56 [rand_harvestq]
root     7   0.0  0.0     0    16  -  DL   23:24      0:03.14 [mmcsd0: mmc/sd card]
root     8   0.0  0.0     0    48  -  DL   23:24      0:05.74 [pagedaemon]
root     9   0.0  0.0     0    16  -  DL   23:24      0:00.00 [vmdaemon]
root    10   0.0  0.0     0    16  -  DL   23:24      0:00.00 [audit]
root    12   0.0  0.0     0   256  -  WL   23:24      1:17.77 [intr]
root    13   0.0  0.0     0    48  -  DL   23:24      0:01.14 [geom]
root    14   0.0  0.0     0    16  -  DL   23:24      0:00.00 [sequencer 00]
root    15   0.0  0.0     0    96  -  DL   23:24      0:53.91 [usb]
root    16   0.0  0.0     0    48  -  DL   23:24      0:02.88 [bufdaemon]
root    17   0.0  0.0     0    16  -  DL   23:24      0:00.63 [vnlru]
root    18   0.0  0.0     0    16  -  DL   23:24      1:06.89 [syncer]
root   133   0.0  0.2 12616  1816  -  Is   23:25      0:00.00 adjkerntz -i
root   819   0.0  0.2 13204  2340  -  Is   23:25      0:00.01 dhclient: system.syslog (dhclient)
root   822   0.0  0.3 13204  2520  -  Is   23:25      0:00.01 dhclient: ue0 [priv] (dhclient)
_dhcp  901   0.0  0.3 13208  2572  -  ICs  23:26      0:00.00 dhclient: ue0 (dhclient)
root   910   0.0  0.4 14496  3800  -  Is   23:26      0:00.12 /sbin/devd
root  1112   0.0  0.3 12908  2416  -  Is   23:26      0:00.38 /usr/sbin/syslogd -s
root  1168   0.0  0.2 12724  2012  -  Ss   23:26      0:11.99 /usr/sbin/powerd
root  1217   0.0  0.9 22056  8612  -  Is   23:26      0:00.25 sshd: /usr/sbin/sshd [listener] 0 of 10-100 startups (sshd)
root  1228   0.0  0.2 12952  2324  -  Is   23:26      0:00.66 /usr/sbin/cron -s
usera 1270   0.0  0.6 17572  6068  -  Rs   23:35      0:26.14 tmux: server (/tmp/tmux-1002/default) (tmux)
root  3375   0.0  1.1 22612 10332  -  Is   19:29      0:00.10 sshd-session: usera [priv] (sshd-session)
root  1249   0.0  0.2 12748  2060 u0  Is+  23:26      0:00.01 /usr/libexec/getty 3wire ttyu0
root  1241   0.0  0.2 12748  2068 v0  Is+  23:26      0:00.01 /usr/libexec/getty Pc ttyv0
root  1242   0.0  0.2 12748  2060 v1  Is+  23:26      0:00.01 /usr/libexec/getty Pc ttyv1
root  1243   0.0  0.2 12748  2064 v2  Is+  23:26      0:00.01 /usr/libexec/getty Pc ttyv2
root  1244   0.0  0.2 12748  2060 v3  Is+  23:26      0:00.01 /usr/libexec/getty Pc ttyv3
root  1245   0.0  0.2 12748  2056 v4  Is+  23:26      0:00.01 /usr/libexec/getty Pc ttyv4
root  1246   0.0  0.2 12748  2060 v5  Is+  23:26      0:00.01 /usr/libexec/getty Pc ttyv5
root  1247   0.0  0.2 12748  2068 v6  Is+  23:26      0:00.01 /usr/libexec/getty Pc ttyv6
root  1248   0.0  0.2 12748  2064 v7  Is+  23:26      0:00.01 /usr/libexec/getty Pc ttyv7
usera 3378   0.0  0.3 13404  3048  0  Is   19:29      0:00.03 -sh (sh)
usera 3381   0.0  0.5 15012  4436  0  I+   19:29      0:00.03 tmux: client (/tmp/tmux-1002/default) (tmux)
usera 1271   0.0  0.3 13404  3032  1  Is   23:35      0:00.02 -sh (sh)
usera 1276   0.0  0.3 13404  3016  2  Is+  23:35      0:00.04 -sh (sh)
usera 1317   0.0  0.3 13404  3044  3  Is+  23:46      0:00.13 -sh (sh)
usera 2498   0.0  0.3 13404  3024  4  Is+  08:58      0:00.03 -sh (sh)
usera 1329   0.0  0.3 13404  3024  5  Ss   23:51      0:00.12 -sh (sh)
usera 3431   0.0  0.3 13524  2820  5  R+   19:36      0:00.01 ps -aux

Output of: dmesg

Code:
---<<BOOT>>---
WARNING: Cannot find freebsd,dts-version property, cannot check DTB compliance
Copyright (c) 1992-2023 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 14.3-RELEASE releng/14.3-n271432-8c9ce319fef7 GENERIC arm64
FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)
VT(efifb): resolution 656x416
module scmi already present!
real memory  = 994041856 (947 MB)
avail memory = 945008640 (901 MB)
Starting CPU 1 (1)
Starting CPU 2 (2)
Starting CPU 3 (3)
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
random: unblocking device.
random: entropy device external interface
kbd0 at kbdmux0
ofwbus0: <Open Firmware Device Tree>
simplebus0: <Flattened device tree simple bus> on ofwbus0
ofw_clkbus0: <OFW clocks bus> on ofwbus0
regfix0: <Fixed Regulator> on ofwbus0
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
regfix1: <Fixed Regulator> on ofwbus0
regfix2: <Fixed Regulator> on ofwbus0
regfix3: <Fixed Regulator> on ofwbus0
bcm2835_firmware0: <BCM2835 Firmware> on simplebus0
ofw_clkbus1: <OFW clocks bus> on bcm2835_firmware0
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
psci0: <ARM Power State Co-ordination Interface Driver> on ofwbus0
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
lintc0: <BCM2836 Interrupt Controller> mem 0x40000000-0x400000ff on simplebus0
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
intc0: <BCM2835 Interrupt Controller> mem 0x7e00b200-0x7e00b3ff irq 39 on simplebus0
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
gpio0: <BCM2708/2835 GPIO controller> mem 0x7e200000-0x7e2000b3 irq 7,8 on simplebus0
gpiobus0: <OFW GPIO bus> on gpio0
gpio1: <Raspberry Pi Firmware GPIO controller> on bcm2835_firmware0
gpiobus1: <GPIO bus> on gpio1
regfix0: Cannot configure GPIO pin: 5
REGNODE_INIT failed: 6
regfix0: Cannot register regulator.
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
mbox0: <BCM2835 VideoCore Mailbox> mem 0x7e00b880-0x7e00b8bf irq 6 on simplebus0
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
generic_timer0: <ARMv7 Generic Timer> irq 1,2,3,4 on ofwbus0
Timecounter "ARM MPCore Timecounter" frequency 19200000 Hz quality 1000
Event timer "ARM MPCore Eventtimer" frequency 19200000 Hz quality 1000
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
bcm_dma0: <BCM2835 DMA Controller> mem 0x7e007000-0x7e007eff irq 23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38 on simplebus0
usb_nop_xceiv0: <USB NOP PHY> on ofwbus0
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
bcm2835_clkman0: <BCM283x Clock Manager> mem 0x7e101000-0x7e102fff on simplebus0
gpioc0: <GPIO controller> on gpio0
uart0: <PrimeCell UART (PL011)> mem 0x7e201000-0x7e2011ff irq 9 on simplebus0
uart0: console (115200,n,8,1)
spi0: <BCM2708/2835 SPI controller> mem 0x7e204000-0x7e2041ff irq 11 on simplebus0
spibus0: <OFW SPI bus> on spi0
spibus0: <unknown card> at cs 0 mode 0
spibus0: <unknown card> at cs 1 mode 0
sdhci_bcm0: <Broadcom 2708 SDHCI controller> mem 0x7e300000-0x7e3000ff irq 17 on simplebus0
mmc0: <MMC/SD bus> on sdhci_bcm0
iichb0: <BCM2708/2835 BSC controller> mem 0x7e804000-0x7e804fff irq 20 on simplebus0
bcm283x_dwcotg0: <DWC OTG 2.0 integrated USB controller (bcm283x)> mem 0x7e980000-0x7e98ffff,0x7e006000-0x7e006fff irq 21,22 on simplebus0
usbus1 on bcm283x_dwcotg0
bcmwd0: <BCM2708/2835 Watchdog> mem 0x7e100000-0x7e100113,0x7e00a000-0x7e00a023 on simplebus0
bcmrng0: <Broadcom BCM2835/BCM2838 RNG> mem 0x7e104000-0x7e10400f irq 40 on simplebus0
gpioc1: <GPIO controller> on gpio1
fb0: <BCM2835 VT framebuffer driver> on simplebus0
fb0: keeping existing fb bpp of 32
fbd0 on fb0
WARNING: Device "fb" is Giant locked and may be deleted before FreeBSD 15.0.
VT: Replacing driver "efifb" with new "fb".
fb0: 656x416(656x416@0,0) 32bpp
fb0: fbswap: 1, pitch 2624, base 0x3eaf0000, screen_size 1091584
pmu0: <Performance Monitoring Unit> irq 0 on ofwbus0
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
bcm2835_cpufreq0: <CPU Frequency Control> on cpu0
cpufreq0: <CPU frequency control> on cpu0
clk_fixed2: clock-fixed has no clock-frequency
clk_fixed2: clock-fixed has no clock-frequency
gpioled0: <GPIO LEDs> on ofwbus0
gpioled0: <ACT> failed to map pin
armv8crypto0: CPU lacks AES instructions
Timecounters tick every 1.000 msec
usbus1: 480Mbps High Speed USB v2.0
ugen1.1: <DWCOTG OTG Root HUB> at usbus1
uhub0 on usbus1
uhub0: <DWCOTG OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
mmc0: Card at relative address 1 failed to set high speed timing
mmcsd0: 16GB <SDHC 00000 1.0 SN 00000843 MFG 10/2017 by 158 BE> at mmc0 0.4MHz/4bit/65535-block
iicbus0: <OFW I2C bus> on iichb0
iic0: <I2C generic I/O> on iicbus0
bcm2835_cpufreq0: ARM 600MHz, Core 250MHz, SDRAM 400MHz, Turbo OFF
CPU  0: ARM Cortex-A53 r0p4 affinity:  0
                   Cache Type = <64 byte D-cacheline,64 byte I-cacheline,VIPT ICache,64 byte ERG,64 byte CWG>
 Instruction Set Attributes 0 = <CRC32>
 Instruction Set Attributes 1 = <>
 Instruction Set Attributes 2 = <>
         Processor Features 0 = <AdvSIMD,FP,EL3 32,EL2 32,EL1 32,EL0 32>
Trying to mount root from ufs:/dev/ufs/rootfs [rw]...
         Processor Features 1 = <>
         Processor Features 2 = <>
      Memory Model Features 0 = <TGran4,TGran64,SNSMem,BigEnd,16bit ASID,1TB PA>
      Memory Model Features 1 = <8bit VMID>
      Memory Model Features 2 = <32bit CCIDX,48bit VA>
      Memory Model Features 3 = <>
      Memory Model Features 4 = <>
             Debug Features 0 = <DoubleLock,2 CTX BKPTs,4 Watchpoints,6 Breakpoints,PMUv3,Debugv8>
             Debug Features 1 = <>
         Auxiliary Features 0 = <>
         Auxiliary Features 1 = <>
AArch32 Instruction Set Attributes 5 = <CRC32,SEVL>
AArch32 Media and VFP Features 0 = <FPRound,FPSqrt,FPDivide,DP VFPv3+v4,SP VFPv3+v4,AdvSIMD>
AArch32 Media and VFP Features 1 = <SIMDFMAC,FPHP DP Conv,SIMDHP SP Conv,SIMDSP,SIMDInt,SIMDLS,FPDNaN,FPFtZ>
CPU  1: ARM Cortex-A53 r0p4 affinity:  1
CPU  2: ARM Cortex-A53 r0p4 affinity:  2
CPU  3: ARM Cortex-A53 r0p4 affinity:  3
lintc0: using for IPIs
Release APs...done
TCP_ratelimit: Is now initialized
uhub0: 1 port with 1 removable, self powered
ugen1.2: <vendor 0x0424 product 0x9514> at usbus1
uhub1 on uhub0
uhub1: <vendor 0x0424 product 0x9514, class 9/0, rev 2.00/2.00, addr 2> on usbus1
uhub1: MTT enabled
uhub1: 5 ports with 4 removable, self powered
ugen1.3: <vendor 0x0424 product 0xec00> at usbus1
smsc0 on uhub1
smsc0: <vendor 0x0424 product 0xec00, rev 2.00/2.00, addr 3> on usbus1
smsc0: chip 0xec00, rev. 0002
miibus0: <MII bus> on smsc0
smscphy0: <SMC LAN8700 10/100 interface> PHY 1 on miibus0
smscphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ue0: <USB Ethernet> on smsc0
ue0: Ethernet address: b8:27:eb:72:6b:22
Warning: no time-of-day clock registered, system time will not be set accurately
Dual Console: Serial Primary, Video Secondary
ue0: link state changed to UP
lo0: link state changed to UP
smsc0: chip 0xec00, rev. 0002
ue0: link state changed to DOWN
ue0: link state changed to UP
pid 2575 (sudo), jid 0, uid 0: exited on signal 6 (no core dump - bad address)
 
There is a probleme with your sd card which is not at full speed:

mmc0: Card at relative address 1 failed to set high speed timing
mmcsd0: 16GB &lt;SDHC 00000 1.0 SN 00000843 MFG 10/2017 by 158 BE&gt;[B] at mmc0 0.4MHz/4bit[/B]/65535-block

I have no issue with Sandisk and Lexar SD card on this model.

Same issue here:

Hello,
I successfully installed FreeBSD-12.0-RELEASE-arm64-aarch64-RPI3.img.xz on SD card ADATA 8GB UHS1 and no issue detected. But when I changed card to exactly the same vendor and speed but 32GB I noticed slow performance issue and in dmesg I see:

mmc0: Card at relative address 1 failed to set high speed timing
mmcsd0: 31GB <SDHC SD 0.0 SN 00000028 MFG 09/2017 by 116 J`> at mmc0 0.4MHz/4bit/65535-block


On 8 GB card:

mmcsd0: 8GB <SDHC SD 0.2 SN B6682B0E MFG 11/2016 by 29 AD> at mmc0 41.6MHz/4bit/65535-block

But when I tried freebsd image from www.raspbsd.org no such issue detected on any size of SD card.
If it possible to fix it for FreeBSD-12.0-RELEASE-arm64-aarch64-RPI3.img.xz?

Best regards,
Serg.
 
Back
Top