Skip to content
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: prevent dispatching multiple tasks on the same idle cpu #58

Merged

Commits on Dec 31, 2023

  1. scx_rustland: prevent dispatching multiple tasks on the same idle cpu

    When a task is dispatched we always try to pick the previously used CPU
    (if idle) to minimize the migration overhead. Alternatively, if such CPU
    is not available, we pick any other idle CPU in the system.
    
    However, we don't update the list of idle CPUs as we dispatch tasks,
    therefore we may end up sending multiple tasks to the same idle CPU (if
    their previously used CPU is the same) and we may even skip some idle
    CPUs completely.
    
    Change this logic to make sure that we never dispatch multiple tasks to
    the same idle CPU, by updating the list of idle CPUs as we send tasks to
    the BPF dispatcher.
    
    This also avoids dispatching tasks with a closely matched vruntime to
    the same CPU, thereby negating the advantages of the vruntime ordering.
    With this change in place, we ensure that tasks with a similar vruntime
    are dispatched to different CPUs, leading to significant improvements in
    latency performance.
    
    Signed-off-by: Andrea Righi <[email protected]>
    Andrea Righi committed Dec 31, 2023
    Configuration menu
    Copy the full SHA
    0522219 View commit details
    Browse the repository at this point in the history