Skip to content
Snippets Groups Projects
  • Nadav Har'El's avatar
    0b9fc40b
    Fix assertion failure during many-cpu boot · 0b9fc40b
    Nadav Har'El authored
    
    While booting with many cpus (e.g., run.py -c 20, but I sometimes saw this
    with as few as 7), we crashed while trying to sleep with preemption disabled:
    
    Assertion failed: preemptable() (/home/nyh/osv/include/sched.hh: do_wait_until: 605)
    Aborted
    
    Turns out that since commit 223b2252 (half a year ago), main_cont()
    ran smp_launch() with preemption disabled. But smp_launch creates threads,
    and thread's constructor may sleep (e.g., on the thread_list_mutex), and
    we cannot do this with preemption disabled...
    
    So dropped the preempt_disable()/enable() from main_cont(). The reasoning for
    it as expressed in 223b2252 appears to be no longer relevant.
    
    Fixes #130.
    
    Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
    Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
    0b9fc40b
    History
    Fix assertion failure during many-cpu boot
    Nadav Har'El authored
    
    While booting with many cpus (e.g., run.py -c 20, but I sometimes saw this
    with as few as 7), we crashed while trying to sleep with preemption disabled:
    
    Assertion failed: preemptable() (/home/nyh/osv/include/sched.hh: do_wait_until: 605)
    Aborted
    
    Turns out that since commit 223b2252 (half a year ago), main_cont()
    ran smp_launch() with preemption disabled. But smp_launch creates threads,
    and thread's constructor may sleep (e.g., on the thread_list_mutex), and
    we cannot do this with preemption disabled...
    
    So dropped the preempt_disable()/enable() from main_cont(). The reasoning for
    it as expressed in 223b2252 appears to be no longer relevant.
    
    Fixes #130.
    
    Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
    Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
loader.cc 9.13 KiB