-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parallezing do_unmount
#662
Comments
i don't think passno works. that assumes all mounts are in fstab to begin with, and that's def not a requirement. this should be a compiled program so that it can actually build a graph and then process it as such using threads. i could see there being a benefit to tickling the underlying devices in parallel in case they went to sleep -- waking back up to unmount is def slow. i'm not sure how much overhead there actually is though if all the drives are active and we just ran umount syscall on them in serial. |
I'd like to give this a try and implement a c program that uses Do you think there's a better suitable approach for this specific issue? |
the entire tool should be written in C, not a mix of C & shell |
To be sure I understood correctly, you suggest a
If this is what you suggest, I think is a good Idea to avoid mixing C with shell when is not required. |
correct |
We have a proposed solution here if anyone wants to take a look. |
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
inrc-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 usefstabinfo --passno ''
to get all the pass numbers, then iterate from the largest passno down to 0 usingfstabinfo --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.
The text was updated successfully, but these errors were encountered: