-
Notifications
You must be signed in to change notification settings - Fork 88
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
scx_rustland improvements #47
Conversation
Do not report an exit error message if it's empty. Moreover, distinguish between a graceful exit vs a non-graceful exit. In general, try to follow the behavior of user_exit_info.h for the C schedulers. NOTE: in the future the whole exit handling probably can be moved to a more generic place (scx_utils) to prevent code duplication across schedulers and also to prevent small inconsistencies like this one. Signed-off-by: Andrea Righi <[email protected]>
Provide an interface for the BPF dispatcher and user-space scheduler to share CPU information. This information can empower the user-space scheduler to make more informed decisions and enable the implementation of a broader range of scheduling policies. With this change the BPF dispatcher provides a CPU map (one entry per CPU) that stores the pid that is running on each CPU (0 if the CPU is idle). The CPU map is updated by the BPF dispatcher in the .running() and .stopping() callbacks. The dispatcher then sends to the user-space scheduler a suggestion of the candidate CPU for each task that needs to run (that is always the previously used CPU), along with all the task's information. The user-space scheduler can decide to confirm the selected CPU or to choose a different one, using all the shared CPU information. Lastly, the selected CPU is communicated back to the dispatcher along with all the task's information and the BPF dispatcher takes care of executing the task on the selected CPU, eventually triggering a migration. Signed-off-by: Andrea Righi <[email protected]>
Dispatch tasks in a batch equal to the amount of idle CPUs in the system. This allows to reduce the pressure on the dispatcher queues, improving the effectiveness of the scheduler (by having more tasks sitting in the scheduler task pool) and mitigating potential priority inversion issues. Signed-off-by: Andrea Righi <[email protected]>
Test result: before this change running a |
I generally like the direction. This likely is less performant but gives userspace a lot more control over what happens on the CPUs, and optimizing from there if necessary seems like the right approach. Generally looks good to me. A few comments:
|
Set of changes for scx_rustland that allow to massively improve the user-space scheduler effectiveness, especially for low latency tasks: