Bug 230903

Summary: remount root readonly slow on Alix
Product: Base System Reporter: Stanislaw Halik <sthalik>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Only Me CC: nick, sthalik
Priority: ---    
Version: 11.2-STABLE   
Hardware: Any   
OS: Any   

Description Stanislaw Halik 2018-08-26 05:09:25 UTC
Hey,

On this Alix machine, mounting root readonly after mounting it read-write is slow, as in:

% mount -w /
% time mount -r / # 15-20 seconds

A workaround is to mount the partition async in which case the remount is almost instant. My typical workflow is to mount read-write, break something, then remount read-only for the sake of fsck(8).

The original Alix series use a Compact Flash -> ATA controller. I've observed this behavior with multiple CF cards. Typical WCHAN is `biowr', `wdrain' or both. This behavior persists since at least FreeBSD 10 series.

Note, the CF storage isn't that slow, see:
  cat /usr/lib/* > /dev/null  0.10s user 1.21s system 46% cpu 2.821 total
  cat /usr/bin/* > /dev/null  0.12s user 3.09s system 67% cpu 4.756 total

There are some nasty things in KERNCONF, only to reduce logspam and save time otherwise spent probing for nonexistent controllers. The Alix series have none of these controllers:

-->--
include GENERIC
[trivia]

nooptions   SMP
nooptions   APIC_IO
nodevice    acpi

nodevice    xenpci # fix build
nooptions   XENHVM # idem
nodevice    hyperv # idem
--<--

I can attach various config files (sysctl.conf, rc.conf, dmesg.boot, fstab, KERNCONF) if necessary but they look sane other than the aforementioned KERNCONF.

cheers,
sh