• 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
config Loading commit data...
debian Loading commit data...
demo Loading commit data...
doc Loading commit data...
include Loading commit data...
kernel Loading commit data...
lib Loading commit data...
scripts Loading commit data...
testsuite Loading commit data...
utils Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
Makefile.am Loading commit data...
README Loading commit data...
configure.ac Loading commit data...