scx_lavd: Improve preemption at ops.tick() and ops.qneueue().#1703
Merged
multics69 merged 1 commit intosched-ext:mainfrom Apr 19, 2025
Merged
scx_lavd: Improve preemption at ops.tick() and ops.qneueue().#1703multics69 merged 1 commit intosched-ext:mainfrom
multics69 merged 1 commit intosched-ext:mainfrom
Conversation
The preemption at ops.tick() is cheap because it does not require expensive IPI. However, the quality of the preemption decision is suboptimal using only local information. It is insufficient to check that the current task is less latency-critical than the one in a DSQ. Even if it is true, there is no guarantee that the current task is the least latency-critical among currently running tasks. Moreover, the preemption at ops.tick() is rather redundant with the preemption at ops.qneueue(). The poor, redundant preemption decision pressures ops.enqueue() and ops.dispatch() operations. So, drop the preemption at ops.tick(). On the other hand, the preemption at the ops.enqueue() is more expensive. However, the quality of the decision is better because it tries to find the least latency-critical tasks among the running tasks using the Power of Two Random Choices technique. To avoid unnecessary preemption at ops.enqueue(), make the preemption decision more judiciously by tightening the preemption condition. Signed-off-by: Changwoo Min <[email protected]>
Contributor
This is similar to what I observed with trying to load balancing in the select/enqueue paths. The decisions need to be made fast or scheduling latency becomes an issue. |
hodgesds
approved these changes
Apr 18, 2025
Contributor
Author
Hehe. Your that change was my motivation to revisit this. :-) Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The preemption at ops.tick() is cheap because it does not require expensive IPI. However, the quality of the preemption decision is suboptimal using only local information. It is insufficient to check that the current task is less latency-critical than the one in a DSQ. Even if it is true, there is no guarantee that the current task is the least latency-critical among currently running tasks. Moreover, the preemption at ops.tick() is rather redundant with the preemption at ops.qneueue(). The poor, redundant preemption decision pressures ops.enqueue() and ops.dispatch() operations. So, drop the preemption at ops.tick().
On the other hand, the preemption at the ops.enqueue() is more expensive. However, the quality of the decision is better because it tries to find the least latency-critical tasks among the running tasks using the Power of Two Random Choices technique. To avoid unnecessary preemption at ops.enqueue(), make the preemption decision more judiciously by tightening the preemption condition.