Repository navigation
feat(dag): add per-node WCET estimation - #785
romancardenas wants to merge 2 commits into
Conversation
97cebbb to
2cd41e2
Compare
There was a problem hiding this comment.
I suggest adding wcet: Option<Duration> as an argument to the three register_*_reactor() functions, instead of a separate set_node_wcet() call. None means no estimate, and the analysis treats it as zero, as in this PR. The reasons are:
- Both current callers know the execution time at registration.
rd_gen_to_dagsalready hasexecution_timefor each node, andSome(convert_duration(execution_time))gives the WCET. This PR does not update it, so its WCETs stay zero and the new check always passes. With the argument, every caller must passSome(...)orNoneexplicitly. periodandrelative_deadlineare already registration arguments.- The register functions no longer need to return a public
NodeIndex. This removes two misuses. An index from one DAG passed to another DAG can silently change the WCET of a different node, and aset_node_wcet()call afterfinish_create_dags()stores a value that is never validated. Nonekeeps "no estimate" apart from an estimate of zero.
With this change, set_node_wcet(), the unused get_node_wcet(), and the per-node .map_err(...) calls in test_dag can go. If a later use case needs to update a WCET after registration, a setter can come back then.
2cd41e2 to
6f45743
Compare
|
@atsushi421 I addressed your comments. |
| test_dag::run().await; // test for DAG | ||
| test_dag::run() | ||
| .await | ||
| .map_err(|errors| Cow::Owned(alloc::format!("DAG test failed: {errors:?}")))?; // test for DAG |
There was a problem hiding this comment.
With ?, a failure in test_dag now skips test_dvfs, test_raspi_dvfs, test_voluntary_preemption, and test_edf. The errors also appear only once, in Debug form such as [InfeasibleWcet(1, 0)], instead of through the Display impl that test_dag::run() used before. Can you keep the previous log-and-continue handling in test_dag::run(), as rd_gen_to_dags/src/lib.rs does, and leave this file unchanged?
There was a problem hiding this comment.
The skipped tests and the Debug output are fixed, thanks. Can you still move the log-and-continue handling back into test_dag::run() and leave userland/src/lib.rs unchanged, as rd_gen_to_dags does?
| //! rejects estimates whose longest dependency path exceeds the sink's relative deadline. | ||
| //! | ||
| //! WCET estimates are used for feasibility validation only. They do not change interval-tick job | ||
| //! release times or the existing GEDF deadline assignment: GEDF continues to use the job release |
There was a problem hiding this comment.
This is the only "GEDF" in the tree. The scheduler is SchedulerType::EDF, and DAGs also run under other schedulers, for example PrioritizedFIFO in rd_gen_to_dags. Can you write "the DAG deadline assignment used by the EDF scheduler" and number this heading ## 4. like its siblings?
There was a problem hiding this comment.
"EFG" is a typo for "EDF", and the heading still needs the ## 4. number like its siblings.
6f45743 to
09ba3fc
Compare
|
@atsushi421 I addressed your comments. I pushed them in a new commit. Let me know if it is OK and, after approval, I will squash commits. Also, I left the comments unresolved so you can go to the points of interest and check whether they are resolved. |
09ba3fc to
aac4096
Compare
|
@atsushi421 sorry for the remaining issues. They should be fixed now. |
Description
@atsushi421 this is the third PR from #738
It adds per-node timing information. Users can now optionally provide WCET estimates per node. With them, when validating the DAG, Awkernel will compute estimated earliest start, estimated latest finish, and whether the node belongs to the critical path. If the DAG seems unfeasible, the validation will return an error.
Earliest Start Time
For source nodes, ES = 0
For other nodes, ES = max over predecessors p (ES(p) + WCET(p)
Latest Finish Time
For sink nodes, LF = Deadline
For other nodes, LF = min over successors p (LF(p) - WCET(p))
We can now check if, a priori, the DAG scheduling is feasible
ES + WCET <= LF
How was this PR tested?
scripts/ci.shpasses on my machine.