From 68701fef62414a524987521d1f42db1e4ec1c9ec Mon Sep 17 00:00:00 2001 From: Johny Lin Date: Thu, 6 Feb 2025 06:32:18 +0000 Subject: [PATCH 1/2] schedule: config to build LL without task rescheduling adds a config to instantiate the low-latency scheduler without task rescheduling, given that the operation is optional. Signed-off-by: Johny Lin --- src/schedule/Kconfig | 10 ++++++++++ src/schedule/ll_schedule.c | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/src/schedule/Kconfig b/src/schedule/Kconfig index d7665aee3581..fc917c252809 100644 --- a/src/schedule/Kconfig +++ b/src/schedule/Kconfig @@ -41,3 +41,13 @@ config SCHEDULE_LL_STATS_LOG_WINDOW_SIZE Size of the statistics window as a power of two. The window size setting also impacts the rate of reporting. With 1ms scheduler tick, default of 10 results in 1024msec window size. + +config SCHEDULE_LL_NO_RESCHEDULE_TASK + bool "Low-latency scheduler skips task rescheduling" + default n + help + Select this to instantiate the low-latency scheduler without task + rescheduling, given that the operation is optional. Under such cases, + scheduler_ops::reschedule_task will set to NULL instead, tasks with + the attempt to reschedule (e.g. DMA trace works) will be relinguished + directly and return no error. diff --git a/src/schedule/ll_schedule.c b/src/schedule/ll_schedule.c index 8881fd7bd224..7f5d0bca526f 100644 --- a/src/schedule/ll_schedule.c +++ b/src/schedule/ll_schedule.c @@ -684,6 +684,11 @@ static int schedule_ll_task_cancel(void *data, struct task *task) return 0; } +#if CONFIG_SCHEDULE_LL_NO_RESCHEDULE_TASK +/* As a null function pointer */ +#define reschedule_ll_task ((void*)0) + +#else static int reschedule_ll_task(void *data, struct task *task, uint64_t start) { struct ll_schedule_data *sch = data; @@ -717,6 +722,7 @@ static int reschedule_ll_task(void *data, struct task *task, uint64_t start) return 0; } +#endif static void scheduler_free_ll(void *data, uint32_t flags) { From 35eff4cef779af516106060eaa103fbe4ca9b46a Mon Sep 17 00:00:00 2001 From: Johny Lin Date: Thu, 6 Feb 2025 08:04:07 +0000 Subject: [PATCH 2/2] mt8196: set config SCHEDULE_LL_NO_RESCHEDULE_TASK=y to skip reschedule task for LL scheduler on mt8196 platform. Signed-off-by: Johny Lin --- src/arch/xtensa/configs/mt8196_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/arch/xtensa/configs/mt8196_defconfig b/src/arch/xtensa/configs/mt8196_defconfig index 1d9fffedfbd2..f030ddc4fe2f 100644 --- a/src/arch/xtensa/configs/mt8196_defconfig +++ b/src/arch/xtensa/configs/mt8196_defconfig @@ -13,3 +13,4 @@ CONFIG_COMP_KPB=n CONFIG_COMP_SEL=n CONFIG_COMP_ASRC=n CONFIG_DEBUG=y +CONFIG_SCHEDULE_LL_NO_RESCHEDULE_TASK=y