Repository navigation
feat(task): add per-task CPU frequency - #808
Open
Kanata9020 wants to merge 1 commit into
Open
Kanata9020 wants to merge 1 commit into
Kanata9020 wants to merge 1 commit into
Conversation
romancardenas
requested changes
Nov 18, 2026
Kanata9020
force-pushed
the
task-dvfs-freq
branch
from
November 19, 2026 05:07
47f27b4 to
25a7bb1
Compare
romancardenas
requested changes
Nov 19, 2026
romancardenas
left a comment
Contributor
There was a problem hiding this comment.
Thanks! A minor comment
Add `task::spawn_with_freq()` to run a task at a given CPU frequency. A task without a frequency runs at the maximum, and an idle CPU runs at the minimum. The `dvfs` feature enables this. - Add `freq` to `TaskInfo`. - Add `awkernel_lib::dvfs::set_min_cpu_freq()`. - Add test_dvfs_task.
Kanata9020
force-pushed
the
task-dvfs-freq
branch
from
November 19, 2026 06:33
25a7bb1 to
d2074af
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add
task::spawn_with_freq()to run a task at a given CPU frequency. Thedvfsfeature ofawkernel_async_libenables this, and thedvfsfeature of the kernel now turns it on.run_main()sets the CPU frequency as follows:flowchart TD Start([start]) --> C1{"ready task in queue?"} C1 -- Yes --> P1[retrieve task] C1 -- No --> P0[set min frequency] P1 --> C2{"task has frequency?"} C2 -- Yes --> P3A[set CPU frequency] C2 -- No --> P3B[set max frequency] P3A --> P4[execute task] P3B --> P4 P4 --> C1 P0 --> C1Related links
How was this PR tested?
scripts/ci.shpasses on my machine.Notes for reviewers
test_dvfs.test_dvfschanges the CPU frequency directly instead of usingtask::spawn_with_freq(), sorun_main()overwrites its frequency.test_dvfsshould be removed in the future.test_dvfs_taskprints logs withlog::info!(). The logger task that prints them has no frequency, sorun_main()sets the CPU to the maximum frequency whenever it runs. Printing logs in another way in the future would fix this.