Skip to content

Parallezing do_unmount #662

Open
@anthonyryan1

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions