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

rt: make the LIFO slot in the multi-threaded scheduler stealable #4941

Open
carllerche opened this issue Aug 24, 2022 · 4 comments
Open

rt: make the LIFO slot in the multi-threaded scheduler stealable #4941

carllerche opened this issue Aug 24, 2022 · 4 comments
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-runtime Module: tokio/runtime

Comments

@carllerche
Copy link
Member

The multi-threaded scheduler includes a per-worker LIFO slot used to store the last scheduled task. This can improve certain usage patterns, especially message passing between tasks. However, this LIFO slot is not currently stealable.

As a temporary workaround, #4936 adds an unstable configuration option to disable the LIFO slot.

@carllerche carllerche added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. labels Aug 24, 2022
carllerche added a commit that referenced this issue Aug 24, 2022
The multi-threaded scheduler includes a per-worker LIFO slot to
store the last scheduled task. This can improve certain usage patterns,
especially message passing between tasks. However, this LIFO slot is not
currently stealable.

Eventually, the LIFO slot **will** become stealable. However, as a
stop-gap, this unstable option lets users disable the LIFO task when
doing so improves their application's overall performance.

Refs: #4941
@Darksonn Darksonn added the M-runtime Module: tokio/runtime label Aug 25, 2022
@MortenLohne
Copy link

Is there any further information available on this? I seem to have hit some pathological worst-case behavior with very cpu-heavy tasks, where every thread except one ended up totally stalled. Disabling the LIFO slot resolved the problem, giving me a 20x speedup.

@Darksonn
Copy link
Contributor

Darksonn commented Sep 4, 2023

It has not been implemented yet.

@rcoh
Copy link
Contributor

rcoh commented Oct 30, 2024

Should we make a counter that tracks times when if possible, the lifo slot would have been stolen? This could help application authors know if they should try the mitigation.

@gengfanbin

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-runtime Module: tokio/runtime
Projects
None yet
Development

No branches or pull requests

5 participants