Commit 4c39001a authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka
Browse files

cobalt/sched: dovetail: prevent early scheduling on uninit runqueues



Make sure not to raise XNSCHED when setting up the root thread, so
that we can't start rescheduling from irq_exit_pipeline() before all
CPUs have their runqueue fully built.

At this chance, add the missing tracepoint reporting a remote
scheduling request.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 98288382
......@@ -91,6 +91,7 @@ void pipeline_clear_mayday(void) /* May solely affect current. */
irqreturn_t pipeline_reschedule_ipi_handler(int irq, void *dev_id)
{
trace_cobalt_schedule_remote(xnsched_current());
/* Will reschedule from irq_exit_pipeline(). */
......
......@@ -465,7 +465,15 @@ int xnsched_set_policy(struct xnthread *thread,
if (xnthread_test_state(thread, XNREADY))
xnsched_enqueue(thread);
if (!xnthread_test_state(thread, XNDORMANT))
/*
* Make sure not to raise XNSCHED when setting up the root
* thread, so that we can't start rescheduling on interrupt
* exit before all CPUs have their runqueue fully
* built. Filtering on XNROOT here is correct because the root
* thread enters the idle class once as part of the runqueue
* setup process and never leaves it afterwards.
*/
if (!xnthread_test_state(thread, XNDORMANT|XNROOT))
xnsched_set_resched(thread->sched);
return 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment