HomeFreeBSD

mac: use a sleepable rmlock instead of an sx lock

Description

mac: use a sleepable rmlock instead of an sx lock

If any non-static modules are loaded (and mac_ntpd tends to be), the lock is
taken all the time al over the kernel. On platforms like arm64 this results in
an avoidable significant performance degradation. Since write-locking is almost
never needed, use a primitive optimized towards read-locking.

Sample result of building the kernel on tmpfs 11 times:
stock 11142.80s user 6704.44s system 4924% cpu 6:02.42 total
patched 11118.95s user 2374.94s system 4547% cpu 4:56.71 total

Details

Provenance
mjgAuthored on
Parents
rS356119: Add read-mostly sleepable locks
Branches
Unknown
Tags
Unknown