Hasty Briefsbeta

Bilingual

Speed up suspend/resume for FreeBSD

9 months ago
  • #FreeBSD
  • #Suspend/Resume
  • #Performance Optimization
  • The author noticed slower suspend/resume times on their Thinkpad X220 after upgrading to FreeBSD 14.2 and Coreboot compared to FreeBSD 11 with proprietary BIOS.
  • Initial suspicion was on Coreboot/Libreboot, but logs showed they were not the cause of the delay.
  • Enabled kernel log timestamps to analyze suspend/resume times, finding significant delays in USB device handling and WiFi driver issues.
  • Discovered the system was incorrectly detecting a second battery, which was disabled via `/boot/device.hints`.
  • Replaced the problematic `iwm` WiFi driver with `iwlwifi`, which improved performance.
  • Disabled unnecessary USB devices and services (webcamd, Bluetooth) to reduce suspend/resume overhead.
  • Adjusted USB-related sysctl settings to minimize wait times during suspend/shutdown.
  • Final optimizations reduced suspend time from ~19.25s to ~9.69s and resume time from ~72.97s to ~7.96s.