Description
I've been exploring shutdown times on some OpenRC servers with up to 100 hard drives connected to each machine.
I found that one of the primary bottlenecks is the sequential nature of do_unmount
in rc-mount.sh
. On a machine with hundreds of mount points, it will iterate through them sequentially one after another.
My first idea was to run each unmount command in the background with &
. But that would break assumptions about unmount order, potentially creating unmount errors for people with filesystems mounted inside racing their parent to unmount.
I'm thinking the correct way to make do_unmount
run in parallel would be to use fstabinfo --passno ''
to get all the pass numbers, then iterate from the largest passno down to 0 using fstabinfo --passno =N
to decide which drives can be unmounted in parallel during each batch.
I'm currently looking for feedback and concerns before creating a pull request.
Activity