Skip to content
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

kernel: timeslicing: add time slice reset in slice per thread api #71855

Conversation

abonislawski
Copy link
Member

This will reset time slice in k_thread_time_slice_set() when slice per thread api is used.

Currently it will reset it only in standard k_thread_time_slice_set

This will reset time slice in k_thread_time_slice_set()
when slice per thread api is used.

Currently it will reset it only in standard slice_set

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
@zephyrbot zephyrbot added Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. area: Kernel labels Apr 24, 2024
@abonislawski abonislawski added the platform: Intel ADSP Intel Audio platforms label Apr 24, 2024
@nashif nashif removed the platform: Intel ADSP Intel Audio platforms label May 1, 2024
Copy link
Contributor

@andyross andyross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. The original intent of the API was that timeslice parameters would be set only on non-running threads. Not opposed in principle to making this work everywhere, but it's worth pointing out that this is extra code to handle what the framework almost certainly is doing already? What's the use case? Just setting your own timeslice?

Might be worth adding a note to the API docs to explain that the results are applied synchronously and that this will result in the reset of an already-partially-executed timeslice (i.e. that the thread is likely to get "more" time because of this call than it would have expected).

@fabiobaltieri fabiobaltieri merged commit e44d2e6 into zephyrproject-rtos:main May 1, 2024
35 checks passed
@abonislawski
Copy link
Member Author

@andyross use case is described here (Task with Budget part):
https://thesofproject.github.io/latest/architectures/firmware/sof-zephyr/mpp_layer/mpp_scheduling.html
early implementation:
thesofproject/sof#9075

so basically we want to set and reset timeslice with each LL tick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Kernel Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants