-
Notifications
You must be signed in to change notification settings - Fork 670
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
Library - Pull a batch of Kernel request and process them by a thread pool #981
Comments
It might help to take a look at @Corillian PR that already used a thread pool except each of them were pulling the kernel request at the same time. |
Adding more details for anyone looking into this. Please do not hesitate if you have any questions! Batched events are built by NotificationLoop in the Kernel. Line 244 in 4208150
The EVENT_CONTEXT from the WorkQueue -> workItem->EventContext list are all append to the PendingIoctls buffers that directly comes from the userland function DokanLoop .Lines 298 to 319 in 4208150
The idea would be to have DokanLoop to be only used by one thread to pull the batched events from the driver. (Also grow the current buffer by 4 to batch more events).Lines 448 to 458 in 31f8381
Unstack all EVENT_CONTEXT and forward them to a new thread pool that will process them.Lines 485 to 528 in 31f8381
To know if the buffer contains more events, we simply need to check if the remaining space can contain a EVENT_CONTEXT and if it is valid (EventContext.Length).
For information, IpcBatching also allows the library to send batches of responses to the Kernel. Lines 524 to 529 in 4208150
|
The last version now has the option in the kernel if anyone would like to take a look at it https://github.com/dokan-dev/dokany/releases/tag/v1.5.0.1000 |
This is done as part of 2.0.0 |
The kernel has a new option that can batch requests instead of sending them one by one. Enabling this option with the current library would not make sense as one thread might be loaded with requests and the others will be waiting.
Therefore we should move the library to a single thread that pulls a batch of Kernel requests and processes them by a thread pool.
dokany/sys/dokan.h
Lines 289 to 292 in 9d7bc12
This is a great performance improvement.
This feature is waiting for external contributions to be happening. I would be glad to review any PR!
The text was updated successfully, but these errors were encountered: