-
Notifications
You must be signed in to change notification settings - Fork 25
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
Wait for ueventd to create loop device on Android #61
base: master
Are you sure you want to change the base?
Conversation
I will try it with inotify :) |
We need this PR : notify-rs/notify#470 to be merged first |
The Sidenote: I use inotify-rs on Android in production. |
If you only need inotify [the linux event API], and no other OS support, then notify [the crate] is probably overkill and inotify-rs could be enough. |
And i did a benchmark: Without inotify:
With inotify:
Both are release build for arm64-v8a, It is about 12ms faster. |
Maybe we change the interval wait time to 1ms without inotify, and it should also work |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure wether a fast poll with an initial may be a better idea.
There's a hardcoded 2s
timeout that can bite.
Is WatchMask::LCREATE
firing? Think there can be the case where the looped files are are already present, free and yielded by LOOP_CTL_GET_FREE
.
What should we do now? I changed it to loop wait 1ms |
hi @mdaffin. What's your opinion on that? |
I've been using this fix for quite some time now: https://github.com/tiann/KernelSU/blob/main/userspace/ksud/Cargo.toml#L38, but I had to maintain my own branch. Would you consider merging it in? I'm open to any suggestions you may have. |
@mdaffin Could you please check this? |
I am not a huge fan of spinning on a 1ms delay for up to 2 seconds. It is all well and good if your tests are coming back in ~6ms, but then that raises the question as to what situation it could take to to 2 seconds to update. If we want a delay loop I think it might be better for an exponential back off instead - ie double the delay until a reasonable limit or the timeout is hit? Or does that sound like too much complexity? Sorry for the delay in looking at this. |
Reference: https://cs.android.com/android/_/android/platform/external/toybox/+/51a43ad5225153582b40d3fd289701efc63c8f62