From 5737b5c84345a8e5ad9b35ed494afafaffe32a29 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Tue, 4 Feb 2020 13:52:09 -0800 Subject: [PATCH] kernel/sched: Re-add IPI calls on k_wakeup() and k_thread_priority_set() These got dropped by an earlier patch, but are required on SMP systems so synchronously notify other CPUs of changed scheduler state. Signed-off-by: Andy Ross --- kernel/sched.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/sched.c b/kernel/sched.c index a537308f81b..8572d6aa24a 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -674,6 +674,10 @@ void z_thread_priority_set(struct k_thread *thread, int prio) { bool need_sched = z_set_prio(thread, prio); +#if defined(CONFIG_SMP) && defined(CONFIG_SCHED_IPI_SUPPORTED) + arch_sched_ipi(); +#endif + if (need_sched && _current->base.sched_locked == 0) { z_reschedule_unlocked(); } @@ -1186,6 +1190,10 @@ void z_impl_k_wakeup(k_tid_t thread) z_mark_thread_as_not_suspended(thread); z_ready_thread(thread); +#if defined(CONFIG_SMP) && defined(CONFIG_SCHED_IPI_SUPPORTED) + arch_sched_ipi(); +#endif + if (!arch_is_in_isr()) { z_reschedule_unlocked(); }