Repository navigation
feat(scheduler): separated EDF from common clustered scheduling logic - #813
romancardenas wants to merge 1 commit into
Conversation
atsushi421
left a comment
There was a problem hiding this comment.
The # Implementing a clustered scheduler doc on the Scheduler trait in scheduler.rs and the last paragraph of the EDF section in mdbook/src/internal/scheduler.md still tell a new clustered scheduler to wrap its queue entries in ClusteredTask and to implement queued_cpu_mask() by hand. ClusteredScheduler<O> now does both, so consider pointing these texts to ClusteredOrdering instead. The PRIORITY_LIST prefix and is_clustered() requirement still applies.
scripts/ci.sh runs fmt, the target checks, clippy, udeps, and the host unit tests. None of these reach ClusteredScheduler::wake_task, get_next, or invoke_preemption. Please run test_edf and test_dag on QEMU and add the result to the description, because only those tests exercise the moved code.
|
|
||
| let Some((victim_cpu, target_task)) = victim else { | ||
| return false; | ||
| let deadline = match &info.dag_info { |
There was a problem hiding this comment.
Reading info.dag_info directly here removes the only caller of TaskInfo::get_dag_info() in task.rs. Consider removing the accessor, unless it is part of the public API on purpose.
Description
Separate how clustered tasks run from how EDF orders them.
clustered.rshandles CPU affinity, the ready queue, dispatch, and preemption.edf.rssupplies the ordering rule: the task with the earliest absolute deadline runs first among tasks eligible for the current CPU.The internal
ClusteredOrderingtrait identifies the scheduler throughKINDand supplies(absolute_deadline, ordering_time)once per wake:absolute_deadlineordering_timeMAX_TASK_PRIORITY - ordering_time, so earlier values rank higher.EDF returns
(deadline, deadline)because the real deadline also determines its ordering. The shared scheduler separately addswake_timeas the tie-breaker, so the actual EDF queue key remains(deadline, wake_time).Related links
None.
How was this PR tested?
scripts/ci.shpasses on my machine.Notes for reviewers
This is a behavior-preserving refactor. The two tuple elements are separate so a future scheduler can use a different ordering key without replacing the real deadline. This PR does not add Latest Finish scheduling or change DAG timing.