fix: Renaming the Task State (Ready to Initialized)#661
Conversation
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
There was a problem hiding this comment.
Pull Request Overview
This PR renames the Ready task state to Initialized across the awkernel codebase to better align with OS industry terminology, where Ready and Runnable are typically synonymous. The change aims to make it clearer that tasks in this state have completed initialization but are not yet runnable.
Key changes:
- Renamed
State::ReadytoState::Initializedin the task state enum - Updated all references in Rust source code and formal specifications (Promela/TLA+)
- Updated state transition checks and initializations across cooperative and preemptive schedulers
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| awkernel_async_lib/src/task.rs | Updated State enum definition and state checks in task implementation |
| specification/awkernel_async_lib/src/task/preemptive_spin/preemptive.pml | Updated state check in wake() function |
| specification/awkernel_async_lib/src/task/preemptive_spin/data_structure.pml | Updated mtype definition and default task state |
| specification/awkernel_async_lib/src/task/preemptive_spin/README.md | Updated verification output examples |
| specification/awkernel_async_lib/src/task/cooperative_with_infinite_loop/cooperative_with_infinite_loop.tla | Updated state initialization and checks in TLA+ spec |
| specification/awkernel_async_lib/src/task/cooperative_spin/cooperative.pml | Updated mtype definition and state checks |
| specification/awkernel_async_lib/src/task/cooperative/cooperative.tla | Updated state initialization and checks in TLA+ spec |
| specification/awkernel_async_lib/src/task/cooperative/README.md | Updated documentation and state diagram |
Comments suppressed due to low confidence (3)
specification/awkernel_async_lib/src/task/cooperative_spin/cooperative.pml:243
- The value
Readyis no longer defined in themtypeafter being renamed toInitializedon line 11. This should betasks[i].state = Initialized;to match the updated mtype definition.
tasks[i].state = Ready;
specification/awkernel_async_lib/src/task/preemptive_spin/README.md:276
- This verification output shows
state = Readybut should showstate = Initializedto reflect the renamed task state. This trace output needs to be regenerated or manually updated to match the code changes.
wake() call wake_task(): tid = 2,task = 1,state = Ready
specification/awkernel_async_lib/src/task/preemptive_spin/README.md:279
- This verification output shows
state = Readybut should showstate = Initializedto reflect the renamed task state. This trace output needs to be regenerated or manually updated to match the code changes.
wake() call wake_task(): tid = 2,task = 0,state = Ready
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
specification/awkernel_async_lib/src/task/cooperative_spin/cooperative.pml
Show resolved
Hide resolved
specification/awkernel_async_lib/src/task/preemptive_spin/data_structure.pml
Show resolved
Hide resolved
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@nokosaaan |
|
I conducted the test and added the results to “How was this PR tested?”. |
|
@nokosaaan |
|
@atsushi421 |
Oh, sorry. It's my falut. |
Description
・The
Readystate andRunnablestate are treated as synonymous in the OS industry.・If the intent is to indicate that task initialization is complete,
Initializedis more appropriate thanReady.Related links
google slide (Reported at the meeting on November 18, 2025)
How was this PR tested?
wakeintask.rs. After changing fromReadytoInitialized, you can confirm that task execution and state transitions are functioning correctly.[before]
[ 11208 DEBUG] /home/nokosan/azumi-lab/awkernel6/applications/tests/test_dag/src/lib.rs:18: period is 1000000000 [ns]
[ 11208 INFO] task#12 state: Ready-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 1 })
[ 11208 INFO] task#13 state: Ready-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 2 })
[ 11208 INFO] task#14 state: Ready-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 3 })
[ 11208 INFO] task#15 state: Ready-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 4 })
[ 11208 INFO] task#16 state: Ready-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 0 })
[ 11209 INFO] task#16 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 0 })
[ 11309 INFO] task#12 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 1 })
[ 11309 INFO] task#16 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 0 })
[ 11309 INFO] task#13 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 2 })
[ 11309 INFO] task#12 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 1 })
[ 11309 INFO] task#15 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 4 })
[ 11309 INFO] task#14 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 3 })
[ 11309 INFO] task#13 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 2 })
[ 11309 INFO] task#14 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 3 })
[ 11309 INFO] task#12 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 1 })
[ 12209 INFO] task#16 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 0 })
[ 12309 INFO] task#12 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 1 })
[ 12309 INFO] task#16 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 0 })
[ 12309 INFO] task#13 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 2 })
[ 12309 INFO] task#12 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 1 })
[ 12309 INFO] task#15 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 4 })
[ 12309 INFO] task#14 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 3 })
[ 12309 INFO] task#13 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 2 })
[ 12309 INFO] task#14 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 3 })
[ 12309 INFO] task#12 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 1 })
[ 13209 INFO] task#16 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 0 })
[after]
[ 11208 DEBUG] /home/nokosan/azumi-lab/awkernel5/applications/tests/test_dag/src/lib.rs:18: period is 1000000000 [ns]
[ 11209 INFO] task#12 state: Initialized-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 1 })
[ 11209 INFO] task#13 state: Initialized-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 2 })
[ 11209 INFO] task#14 state: Initialized-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 3 })
[ 11209 INFO] task#15 state: Initialized-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 4 })
[ 11209 INFO] task#16 state: Initialized-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 0 })
[ 11209 INFO] task#16 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 0 })
[ 11309 INFO] task#12 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 1 })
[ 11309 INFO] task#16 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 0 })
[ 11309 INFO] task#13 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 2 })
[ 11309 INFO] task#12 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 1 })
[ 11309 INFO] task#15 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 4 })
[ 11309 INFO] task#14 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 3 })
[ 11309 INFO] task#13 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 2 })
[ 11309 INFO] task#15 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 4 })
[ 11309 INFO] task#12 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 1 })
[ 11309 INFO] task#14 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 3 })
[ 12209 INFO] task#16 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 0 })
[ 12309 INFO] task#12 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 1 })
[ 12309 INFO] task#16 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 0 })
[ 12309 INFO] task#13 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 2 })
[ 12309 INFO] task#12 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 1 })
[ 12309 INFO] task#15 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 4 })
[ 12309 INFO] task#14 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 3 })
[ 12309 INFO] task#13 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 2 })
[ 12309 INFO] task#14 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 3 })
[ 12309 INFO] task#12 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 1 })
[ 13209 INFO] task#16 state: Waiting-> Runnable dag_info: Some(DagInfo { dag_id: 1, node_id: 0 })
Notes for reviewers