• Philippe Gerum's avatar
    cobalt/sched: guard against missed rescheduling upon CPU migration · d540b504
    Philippe Gerum authored
    Kicking the rescheduling procedure (xnsched_run()) from call sites
    running over the root thread with hard irqs enabled may lead to
    missing a rescheduling opportunity as a consequence of a CPU
    migration, e.g.:
    
        CPU0					CPU1
        ----                         		----
        t0: ...
                <context switch>
        t1: xnthread_resume(t0)
                 xnsched_run()
                 <CPU MIGRATION -->
                      |                             |
                      |                             |
                      x                             |
              (missed rescheduling)                 v
                                        ___xnsched_run(CPU1.sched)
    
    To address this issue, make sure every call to xnsched_run() either
    runs from the head domain which is not affected by CPU migration, or
    moves into the latest atomic section which might have changed the
    scheduler state.
    
    Turning on CONFIG_XENO_OPT_DEBUG_COBALT also enables a (oneshot)
    assertion which detects invalid calls from the root domain with hard
    irqs enabled.
    Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
    Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
    d540b504
Name
Last commit
Last update
..
alchemy Loading commit data...
boilerplate Loading commit data...
cobalt Loading commit data...
copperplate Loading commit data...
mercury Loading commit data...
psos Loading commit data...
rtdm Loading commit data...
smokey Loading commit data...
trank Loading commit data...
vxworks Loading commit data...
xenomai Loading commit data...
COPYING Loading commit data...
Makefile.am Loading commit data...