-
-
Notifications
You must be signed in to change notification settings - Fork 180
Move idle task out of run queue #982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move idle task out of run queue #982
Conversation
The short of it is that our priority scheduler isn't actually a priority scheduler. I initially made a large PR with a bunch of scheduler changes but realised that because of all the renaming, file history was lost, so I've split the PR into a bunch of smaller PRs. After this is merged I'll create a PR to rename `scheduler_realtime` to `scheduler_priority`. Signed-off-by: Klimenty Tsoutsman <[email protected]>
Depends on theseus-os#980. The realtime scheduler doesn't actually implement rate monotonic scheduling as the period is just used as a glorified inverse priority. Next steps in the scheduler saga: - Allow changing scheduler policy live - Merge `set_priority` and `set_periodicity` (as the periodicity isn't properly used) - Merge scheduler and run queue crates (pending discussion on Discord) - Update docs to better explain crates, particularly `scheduler_epoch` I've implemented some of these and will open a PR once theseus-os#980 and theseus-os#981 are merged. Signed-off-by: Klimenty Tsoutsman <[email protected]>
Signed-off-by: Klimenty Tsoutsman <[email protected]>
b680ba1
to
181b884
Compare
Signed-off-by: Klimenty Tsoutsman <[email protected]>
Signed-off-by: Klimenty Tsoutsman <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Regarding the "TODO"s/questions you left, I think it's probably best to continue to return an Option<TaskRef>
from select_next_task()
, and then have the schedule()
function select an idle task independently of the runqueue. This goes hand-in-hand with another change we can make, which is to move the idle task into CPU-local storage, since it "belongs" a CPU instance rather than a runqueue instance. This also makes the runqueue design have fewer concerns and also more flexible, since we may not always want to create exactly one runqueue per CPU.
I'll likely make some of those changes later, or you can do it as part of your series of scheduler PRs; your call.
* As part of our ongoing scheduler/runqueue redesign, there is no real reason to store each CPU's idle task in a scheduler runqueue. They are only used separately as a "last resort" when no runnable tasks exist, so we can store them alongside the runqueue rather than inside it. * Also, we change the creation of idle tasks to be done as part of initializing the tasking subsystem on each CPU rather than as an explicit step in the captain's init routine. * In the future, each CPU's idle task can be stored in CPU-local storage, since they ideologically "belong" to a CPU instance rather than a runqueue instance. * Unrelated: move `state_transfer` to old crates, as it currently doesn't build any more due to the ongoing scheduler/runqueue changes. Signed-off-by: Klimenty Tsoutsman <[email protected]> 18dc5f5
* As part of our ongoing scheduler/runqueue redesign, there is no real reason to store each CPU's idle task in a scheduler runqueue. They are only used separately as a "last resort" when no runnable tasks exist, so we can store them alongside the runqueue rather than inside it. * Also, we change the creation of idle tasks to be done as part of initializing the tasking subsystem on each CPU rather than as an explicit step in the captain's init routine. * In the future, each CPU's idle task can be stored in CPU-local storage, since they ideologically "belong" to a CPU instance rather than a runqueue instance. * Unrelated: move `state_transfer` to old crates, as it currently doesn't build any more due to the ongoing scheduler/runqueue changes. Signed-off-by: Klimenty Tsoutsman <[email protected]> 18dc5f5
Depends on #980 and #981.
Moves
state_transfer
toold_crates
because it no longer compiles and would need to be reworked, but it wasn't functional in the first place.