Thanks to visit codestin.com
Credit goes to github.com

Skip to content

scx_lavd: Improve preemption at ops.tick() and ops.qneueue().#1703

Merged
multics69 merged 1 commit intosched-ext:mainfrom
multics69:lavd-preempt
Apr 19, 2025
Merged

scx_lavd: Improve preemption at ops.tick() and ops.qneueue().#1703
multics69 merged 1 commit intosched-ext:mainfrom
multics69:lavd-preempt

Conversation

@multics69
Copy link
Contributor

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.

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]>
@multics69 multics69 requested review from arighi, hodgesds and htejun April 18, 2025 23:24
@hodgesds
Copy link
Contributor

To avoid unnecessary preemption at ops.enqueue(), make the preemption decision more judiciously by tightening the preemption condition.

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.

@multics69
Copy link
Contributor Author

multics69 commented Apr 18, 2025

To avoid unnecessary preemption at ops.enqueue(), make the preemption decision more judiciously by tightening the preemption condition.

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.

Hehe. Your that change was my motivation to revisit this. :-) Thanks!

@multics69 multics69 added this pull request to the merge queue Apr 18, 2025
Merged via the queue into sched-ext:main with commit 34d38ef Apr 19, 2025
16 checks passed
@multics69 multics69 deleted the lavd-preempt branch April 19, 2025 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments