Page MenuHomeFreeBSD

loader: Don't free bcache for devices of type DEVT_DISK
ClosedPublic

Authored by cperciva on Sep 30 2021, 8:52 PM.

Details

Summary

In my testing, this speeds up the loader from 513 ms to 474 ms, reduces the number of I/Os performed from 609 to 432, and reduces the total number of blocks read from 61963 to 60797.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

This solves the "calling mount doesn't actually hold the disk open if there's no filesystem to mount" problem.

Seems good to my eye.

This revision is now accepted and ready to land.Sep 30 2021, 8:58 PM

The obvious flaw is about possible unfreed memory, but that shouldn't be big problem anyhow.