From 8709745709e472f75a2aa42cdd78dcc702fbf7e6 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Tue, 28 Jul 2020 10:12:47 -0500 Subject: [PATCH 1/3] Revert "idc: set budget for IDC task" This reverts commit 443319a7186b47b8e51fad4ee481b57bcabf476d. Signed-off-by: Pierre-Louis Bossart --- Kconfig | 7 ------- src/idc/idc.c | 6 ++---- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/Kconfig b/Kconfig index 1378d255279b..9ea7ff644881 100644 --- a/Kconfig +++ b/Kconfig @@ -127,13 +127,6 @@ config INTERRUPT_LEVEL_5 rsource "src/Kconfig" -config IDC_TASK_BUDGET - int "Cycles budget for IDC task" - depends on MULTICORE - default 8000 - help - Cycles budget for IDC task per systick (see config SYSTICK). - choice prompt "Optimization" default OPTIMIZE_FOR_PERFORMANCE diff --git a/src/idc/idc.c b/src/idc/idc.c index 363b58af1113..5f65662e2e5d 100644 --- a/src/idc/idc.c +++ b/src/idc/idc.c @@ -325,10 +325,8 @@ int idc_init(void) (*idc)->payload = cache_to_uncache((struct idc_payload *)payload); /* process task */ - schedule_task_init_edf_with_budget(&(*idc)->idc_task, - SOF_UUID(idc_cmd_task_uuid), - &ops, *idc, cpu_get_id(), 0, - CONFIG_IDC_TASK_BUDGET); + schedule_task_init_edf(&(*idc)->idc_task, SOF_UUID(idc_cmd_task_uuid), + &ops, *idc, cpu_get_id(), 0); return platform_idc_init(); } From 8ae9689ec6b6db3f4f80d17dae9284052c61f2ca Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Tue, 28 Jul 2020 10:13:01 -0500 Subject: [PATCH 2/3] Revert "drivers: cavs: set budget for IPC task" This reverts commit e8dc076f7ad70325c6061fb016267f72c78e2ff8. Signed-off-by: Pierre-Louis Bossart --- src/drivers/intel/Kconfig | 7 ------- src/drivers/intel/cavs/ipc.c | 6 ++---- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/drivers/intel/Kconfig b/src/drivers/intel/Kconfig index ffbb172130bd..aad635124ae9 100644 --- a/src/drivers/intel/Kconfig +++ b/src/drivers/intel/Kconfig @@ -47,13 +47,6 @@ config INTEL_DMIC Select this to enable Intel DMIC driver. The DMIC driver provides as DAI the SoC direct attach digital microphones interface. -config INTEL_CAVS_IPC_TASK_BUDGET - int "Intel cycles budget for IPC task" - depends on CAVS - default 8000 - help - Cycles budget for IPC task per systick (see config SYSTICK). - if INTEL_DMIC choice diff --git a/src/drivers/intel/cavs/ipc.c b/src/drivers/intel/cavs/ipc.c index a689bcfefd7f..7d335fce6a73 100644 --- a/src/drivers/intel/cavs/ipc.c +++ b/src/drivers/intel/cavs/ipc.c @@ -296,10 +296,8 @@ int platform_ipc_init(struct ipc *ipc) ipc_set_drvdata(ipc, NULL); /* schedule */ - schedule_task_init_edf_with_budget(&ipc->ipc_task, - SOF_UUID(ipc_task_uuid), - &ipc_task_ops, ipc, 0, 0, - CONFIG_INTEL_CAVS_IPC_TASK_BUDGET); + schedule_task_init_edf(&ipc->ipc_task, SOF_UUID(ipc_task_uuid), + &ipc_task_ops, ipc, 0, 0); /* configure interrupt */ irq = interrupt_get_irq(PLATFORM_IPC_INTERRUPT, From e946a134c1f3a3d093bb43c08afc8b93d5ec579f Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Tue, 28 Jul 2020 10:13:12 -0500 Subject: [PATCH 3/3] Revert "schedule: edf: cycles budget" This reverts commit e003afe582e41c4a8a52b21d45dbc83c166021a5. Signed-off-by: Pierre-Louis Bossart --- src/include/sof/schedule/edf_schedule.h | 10 ----- src/schedule/edf_schedule.c | 56 +------------------------ 2 files changed, 1 insertion(+), 65 deletions(-) diff --git a/src/include/sof/schedule/edf_schedule.h b/src/include/sof/schedule/edf_schedule.h index 04dfdd7be663..5bf552a06969 100644 --- a/src/include/sof/schedule/edf_schedule.h +++ b/src/include/sof/schedule/edf_schedule.h @@ -12,7 +12,6 @@ #include #include #include -#include #define edf_sch_set_pdata(task, data) \ (task->priv_data = data) @@ -21,10 +20,6 @@ struct edf_task_pdata { void *ctx; - uint32_t budget; /**< cycles per systick */ - uint64_t last_systick; /**< last systick in which budget - * was granted to task - */ }; int scheduler_init_edf(void); @@ -33,9 +28,4 @@ int schedule_task_init_edf(struct task *task, uint32_t uid, const struct task_ops *ops, void *data, uint16_t core, uint32_t flags); -int schedule_task_init_edf_with_budget(struct task *task, uint32_t uid, - const struct task_ops *ops, - void *data, uint16_t core, - uint32_t flags, uint32_t cycles_budget); - #endif /* __SOF_SCHEDULE_EDF_SCHEDULE_H__ */ diff --git a/src/schedule/edf_schedule.c b/src/schedule/edf_schedule.c index e0a9ead9ea8c..89b5390ad09e 100644 --- a/src/schedule/edf_schedule.c +++ b/src/schedule/edf_schedule.c @@ -55,26 +55,6 @@ static void schedule_edf_task_run(struct task *task, void *data) } } -static inline uint64_t edf_eval_task_deadline(struct task *task, - uint64_t systick) -{ - struct edf_task_pdata *edf_pdata = edf_sch_get_pdata(task); - - if (!edf_pdata->budget) - return task_get_deadline(task); - - /* check if task was already executed in current systick */ - if (edf_pdata->last_systick != systick) { - edf_pdata->last_systick = systick; - return task_get_deadline(task); - } - - /* when there are no other tasks to run, - * task can be executed even if it used systick's budget, - */ - return SOF_TASK_DEADLINE_ALMOST_IDLE; -} - static void edf_scheduler_run(void *data) { struct edf_schedule_data *edf_sch = data; @@ -84,20 +64,9 @@ static void edf_scheduler_run(void *data) struct task *task; uint64_t deadline; uint32_t flags; - uint64_t systick; tr_dbg(&edf_tr, "edf_scheduler_run()"); - timer_disable(cpu_timer_get(), edf_sch, cpu_get_id()); - - /* budget is given per systick, for example if systick is configured - * as 1ms and budget is 8000 cycles, then task will be able to use - * up to 8MCPS (or more if there are no other tasks) - */ - systick = platform_timer_get(timer_get()) / - (clock_ms_to_ticks(PLATFORM_DEFAULT_CLOCK, 1) - * (CONFIG_SYSTICK_PERIOD / 1000)); - irq_local_disable(flags); /* find next task to run */ @@ -108,7 +77,7 @@ static void edf_scheduler_run(void *data) task->state != SOF_TASK_STATE_RUNNING) continue; - deadline = edf_eval_task_deadline(task, systick); + deadline = task_get_deadline(task); if (deadline == SOF_TASK_DEADLINE_NOW) { /* task needs to be scheduled ASAP */ @@ -165,15 +134,6 @@ static int schedule_edf_task(void *data, struct task *task, uint64_t start, int schedule_task_init_edf(struct task *task, uint32_t uid, const struct task_ops *ops, void *data, uint16_t core, uint32_t flags) -{ - return schedule_task_init_edf_with_budget(task, uid, ops, data, - core, flags, 0); -} - -int schedule_task_init_edf_with_budget(struct task *task, uint32_t uid, - const struct task_ops *ops, - void *data, uint16_t core, - uint32_t flags, uint32_t cycles_budget) { struct edf_task_pdata *edf_pdata = NULL; int ret = 0; @@ -205,8 +165,6 @@ int schedule_task_init_edf_with_budget(struct task *task, uint32_t uid, task->core, NULL, 0) < 0) goto error; - edf_pdata->budget = cycles_budget; - /* flush for slave core */ if (cpu_is_slave(task->core)) dcache_writeback_invalidate_region(edf_pdata, @@ -224,7 +182,6 @@ int schedule_task_init_edf_with_budget(struct task *task, uint32_t uid, static int schedule_edf_task_running(void *data, struct task *task) { - struct edf_schedule_data *edf_sch = data; struct edf_task_pdata *edf_pdata = edf_sch_get_pdata(task); uint32_t flags; @@ -235,13 +192,6 @@ static int schedule_edf_task_running(void *data, struct task *task) task_context_set(edf_pdata->ctx); task->state = SOF_TASK_STATE_RUNNING; - /* if budget is not set then it's not budgeted task */ - if (edf_pdata->budget) { - timer_set(cpu_timer_get(), timer_get_system(cpu_timer_get()) - + edf_pdata->budget); - timer_enable(cpu_timer_get(), edf_sch, cpu_get_id()); - } - irq_local_enable(flags); return 0; @@ -328,8 +278,6 @@ int scheduler_init_edf(void) interrupt_register(edf_sch->irq, edf_scheduler_run, edf_sch); interrupt_enable(edf_sch->irq, edf_sch); - timer_register(cpu_timer_get(), edf_scheduler_run, edf_sch); - return 0; } @@ -340,8 +288,6 @@ static void scheduler_free_edf(void *data) irq_local_disable(flags); - timer_unregister(cpu_timer_get(), edf_sch); - /* disable and unregister EDF scheduler interrupt */ interrupt_disable(edf_sch->irq, edf_sch); interrupt_unregister(edf_sch->irq, edf_sch);