Skip to content

schedule: zephyr_domain: make LL reporting build-time configurable and change the defaults - #9661

Merged
kv2019i merged 3 commits into
thesofproject:mainfrom
kv2019i:202411-ll-stats-configurability
Nov 19, 2024
Merged

kv2019i merged 3 commits into
thesofproject:mainfrom
kv2019i:202411-ll-stats-configurability

Conversation

@kv2019i

@kv2019i kv2019i commented Nov 18, 2024

Copy link
Copy Markdown
Collaborator

Here's a series to make the LL scheduler stat logging more configurable, and tune the defaults using the new tools.

Add Kconfig options to enable and disable the low-latency
scheduler statistics reporting, and to set the window size.

Also add an option to set reporting to be done only for every other
statistics window. This can be useful to exclude impact of
the logging itself. With most current configurations and logging
backends, printing out the scheduling report at the end of
the window, will show up as an execution time spike on the first
iteration of the subsequent measurement window. This can mask
spikes caused by other components in the system.

Defaults match the earlier settings hardcoded in code, so this commit
has no functional change.

Signed-off-by: Kai Vehmanen <[email protected]>
Change the logic how overrun count is reported out in the
low-latency scheduler statistics reporting. Instead of resetting
the overrun count after every window, keep a cumulative count
of overruns seen. Overruns are in practise a rare occurrence and
this change makes the CONFIG_SCHEDULE_LL_STATS_LOG_EVERY_OTHER_WINDOW
option more useful as one can still track overruns for all
executed iterations, even if reporting is done at a slower pace.

Signed-off-by: Kai Vehmanen <[email protected]>
Make SCHEDULE_LL_STATS_LOG_EVERY_OTHER_WINDOW=y the default.
This in practise filters out the impact of the stat logging
from the results. Another impact is that logging rate is halved
to once per two seconds with the new default settings.

Signed-off-by: Kai Vehmanen <[email protected]>
@kv2019i

kv2019i commented Nov 18, 2024

Copy link
Copy Markdown
Collaborator Author

The effect of this series looks like this on a light playback pipeline on Intel MTL target:

BEFORE
[  164.103128] <inf> ll_schedule: zephyr_domain_thread_fn: ll core 0 timer avg 2250, max 6980, overruns 0
[  165.127128] <inf> ll_schedule: zephyr_domain_thread_fn: ll core 0 timer avg 2236, max 3530, overruns 0
[  166.151128] <inf> ll_schedule: zephyr_domain_thread_fn: ll core 0 timer avg 2239, max 3524, overruns 0
[  167.175128] <inf> ll_schedule: zephyr_domain_thread_fn: ll core 0 timer avg 2233, max 3540, overruns 0

AFTER applying this PR
[  163.498341] <inf> ll_schedule: stats_report: ll core 0 timer avg 2242, max 2278, overruns 0
[  165.546341] <inf> ll_schedule: stats_report: ll core 0 timer avg 2241, max 2280, overruns 0
[  167.594341] <inf> ll_schedule: stats_report: ll core 0 timer avg 2239, max 2278, overruns 0
[  169.642341] <inf> ll_schedule: stats_report: ll core 0 timer avg 2225, max 2280, overruns 0

Whether one wants to see the higher max values (they are real cycles consumed after all), depends on what one is trying to debug.

@kv2019i

kv2019i commented Nov 19, 2024

Copy link
Copy Markdown
Collaborator Author

@kv2019i
kv2019i merged commit 0a10481 into thesofproject:main Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants