Skip to content

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

Merged
fabiobaltieri merged 1 commit into
zephyrproject-rtos:mainfrom
abonislawski:time_slice_per_thread_reset
May 1, 2024
Merged

fabiobaltieri merged 1 commit into
zephyrproject-rtos:mainfrom
abonislawski:time_slice_per_thread_reset

Conversation

@abonislawski

Copy link
Copy Markdown
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>
@abonislawski
abonislawski requested a review from nashif April 24, 2024 09:03
@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

@andyross andyross left a comment

Copy link
Copy Markdown
Contributor

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
@abonislawski

Copy link
Copy Markdown
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