Page 1 of 1

“BUG: scheduling while atomic” on real-time kernel

Posted: 10. Mar 2016, 12:34
by Melebius
I am using headless VirtualBox on a Ubuntu Server 14.04 LTS Trusty host running real-time kernel. When loading vboxdrv during boot, the message BUG: scheduling while atomic appears. Initially it made the OS unbootable while I was trying 3.19.x kernel and VirtualBox versions 4.x available from Trusty APT repository. The boot got into Kernel panic and I was no more able to boot the system even with a generic kernel.

I got the machine booting using VirtualBox 5.0.10 from Ubuntu 15.10 Wily and kernel version 4.1.13-rt15. I haven’t noticed any problem in the case the machine boots. (Highest uptime so far had been 1 month until I had to reboot because of a security update.) However, the error message still appears on every boot and sometimes the boot freezes. A cold reboot fixes it mostly but it makes the boot unreliable and prevents me from rebooting the machine remotely.

Related part of dmesg output on successful boot:

Code: Select all

vboxdrv: Found 8 processor cores
BUG: scheduling while atomic: swapper/2/0/0x00010002
BUG: scheduling while atomic: swapper/0/0/0x00010002
Modules linked in:
Modules linked in:
 vboxdrv(OE+)
 vboxdrv(OE+)
 binfmt_misc(E)
 binfmt_misc(E)
 intel_rapl(E)
 intel_rapl(E)
 iosf_mbi(E)
 iosf_mbi(E)
BUG: scheduling while atomic: swapper/7/0/0x00010002
 intel_powerclamp(E)
 intel_powerclamp(E)
Modules linked in:
 coretemp(E)
 coretemp(E)
 vboxdrv(OE+)
 kvm_intel(E)
 kvm_intel(E)
 binfmt_misc(E)
 snd_hda_codec_hdmi(E)
 snd_hda_codec_hdmi(E)
 intel_rapl(E)
 kvm(E)
 kvm(E)
 iosf_mbi(E)
 i915(E)
 i915(E)
 intel_powerclamp(E)
 snd_hda_intel(E)
 snd_hda_intel(E)
 coretemp(E)
 crct10dif_pclmul(E)
 crct10dif_pclmul(E)
 kvm_intel(E)
 drm_kms_helper(E)
 drm_kms_helper(E)
 snd_hda_codec_hdmi(E)
 crc32_pclmul(E)
 crc32_pclmul(E)
 kvm(E)
 snd_hda_controller(E)
 snd_hda_controller(E)
 i915(E)
 drm(E)
 drm(E)
 snd_hda_intel(E)
 aesni_intel(E)
 aesni_intel(E)
 crct10dif_pclmul(E)
 snd_hda_codec(E)
 snd_hda_codec(E)
 drm_kms_helper(E)
 aes_x86_64(E)
 aes_x86_64(E)
 crc32_pclmul(E)
 lrw(E)
 lrw(E)
 snd_hda_controller(E)
 snd_hda_core(E)
 snd_hda_core(E)
 drm(E)
 gf128mul(E)
 gf128mul(E)
 aesni_intel(E)
 snd_hwdep(E)
 snd_hwdep(E)
 snd_hda_codec(E)
 snd_pcm(E)
 snd_pcm(E)
 aes_x86_64(E)
 glue_helper(E)
 glue_helper(E)
 lrw(E)
 ablk_helper(E)
 ablk_helper(E)
 snd_hda_core(E)
 mei_me(E)
 mei_me(E)
 gf128mul(E)
 shpchp(E)
 shpchp(E)
 snd_hwdep(E)
 mei(E)
 mei(E)
 snd_pcm(E)
 cryptd(E)
 cryptd(E)
 glue_helper(E)
 snd_timer(E)
 snd_timer(E)
 ablk_helper(E)
 snd(E)
 snd(E)
 mei_me(E)
 soundcore(E)
 soundcore(E)
 shpchp(E)
 i2c_algo_bit(E)
 i2c_algo_bit(E)
 mei(E)
 lpc_ich(E)
 lpc_ich(E)
 cryptd(E)
 dcdbas(E)
 dcdbas(E)
 snd_timer(E)
 video(E)
 video(E)
 snd(E)
 serio_raw(E)
 serio_raw(E)
 soundcore(E)
 mac_hid(E)
 mac_hid(E)
 i2c_algo_bit(E)
 8250_fintek(E)
 8250_fintek(E)
 lpc_ich(E)
 lp(E)
 lp(E)
 dcdbas(E)
 parport(E)
 parport(E)
 video(E)
 hid_generic(E)
 hid_generic(E)
 serio_raw(E)
 usbhid(E)
 usbhid(E)
 mac_hid(E)
 hid(E)
 hid(E)
 8250_fintek(E)
 psmouse(E)
 psmouse(E)
 lp(E)
 ahci(E)
 ahci(E)
 parport(E)
 libahci(E)
 libahci(E)
 hid_generic(E)
 e1000e(E)
 e1000e(E)
 usbhid(E)
 ptp(E)
 ptp(E)
 hid(E)
 pps_core(E)
 pps_core(E)
 psmouse(E)


 ahci(E)
Preemption disabled at:
Preemption disabled at:
 libahci(E)
[<ffffffff810c4876>] cpu_startup_entry+0x1a6/0x4f0
[<ffffffff810c4876>] cpu_startup_entry+0x1a6/0x4f0
 e1000e(E)


 ptp(E) pps_core(E)
CPU: 2 PID: 0 Comm: swapper/2 Tainted: G           OE   4.1.13-rt15+ #3

Hardware name: Dell Inc. OptiPlex 9020/0PC5F7, BIOS A03 09/17/2013
Preemption disabled at:[<ffffffff810c4876>] cpu_startup_entry+0x1a6/0x4f0
 0000000000018000

 ffff88021ea83d78 ffffffff817e8319 0000000000010003
 ffff88021ea98000 ffff88021ea83d88 ffffffff817e4425 ffff88021ea83dd8
 ffffffff817ebdcb ffff88021ea83df8 ffff880214a4e4b0 0000000000000000
Call Trace:
 <IRQ>  [<ffffffff817e8319>] dump_stack+0x4a/0x61
 [<ffffffff817e4425>] __schedule_bug+0x9d/0xab
 [<ffffffff817ebdcb>] __schedule+0x7cb/0x920
 [<ffffffff817ebf5f>] schedule+0x3f/0xd0
 [<ffffffff817eda1d>] rt_spin_lock_slowlock+0xbd/0x1f0
 [<ffffffff817eee45>] rt_spin_lock+0x25/0x30
 [<ffffffffc05428ee>] VBoxHost_RTSpinlockAcquire+0x5e/0x70 [vboxdrv]
 [<ffffffffc05347c1>] supdrvGipMpEventOnlineOrInitOnCpu+0x61/0x2c0 [vboxdrv]
 [<ffffffffc0534bd5>] supdrvGipInitOnCpu+0x15/0x20 [vboxdrv]
 [<ffffffffc05402d6>] rtmpLinuxAllWrapper+0x46/0x60 [vboxdrv]
 [<ffffffffc0540290>] ? VBoxHost_RTMpGetOnlineSet+0x70/0x70 [vboxdrv]
 [<ffffffff81105225>] flush_smp_call_function_queue+0x85/0x150
 [<ffffffff81105e93>] generic_smp_call_function_single_interrupt+0x13/0x60
 [<ffffffff81050767>] smp_call_function_interrupt+0x27/0x40
 [<ffffffff817f07be>] call_function_interrupt+0x6e/0x80
 <EOI>  [<ffffffff8167c1b9>] ? cpuidle_enter_state+0xa9/0x260
 [<ffffffff8167c188>] ? cpuidle_enter_state+0x78/0x260
 [<ffffffff8167c3a7>] cpuidle_enter+0x17/0x20
 [<ffffffff810c4a6c>] cpu_startup_entry+0x39c/0x4f0
 [<ffffffff8105124f>] start_secondary+0x16f/0x190
CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W  OE   4.1.13-rt15+ #3
Hardware name: Dell Inc. OptiPlex 9020/0PC5F7, BIOS A03 09/17/2013
 0000000000018000 ffff88021ea03d78 ffffffff817e8319 0000000000010003
 ffff88021ea18000 ffff88021ea03d88 ffffffff817e4425 ffff88021ea03dd8
 ffffffff817ebdcb ffff88021ea03df8 ffffffff81c1b4e0 0000000000000000
Call Trace:
 <IRQ>  [<ffffffff817e8319>] dump_stack+0x4a/0x61
 [<ffffffff817e4425>] __schedule_bug+0x9d/0xab
 [<ffffffff817ebdcb>] __schedule+0x7cb/0x920
 [<ffffffff817ebf5f>] schedule+0x3f/0xd0
 [<ffffffff817eda1d>] rt_spin_lock_slowlock+0xbd/0x1f0
 [<ffffffff817eee45>] rt_spin_lock+0x25/0x30
 [<ffffffffc05428ee>] VBoxHost_RTSpinlockAcquire+0x5e/0x70 [vboxdrv]
 [<ffffffffc05347c1>] supdrvGipMpEventOnlineOrInitOnCpu+0x61/0x2c0 [vboxdrv]
 [<ffffffffc0534bd5>] supdrvGipInitOnCpu+0x15/0x20 [vboxdrv]
 [<ffffffffc05402d6>] rtmpLinuxAllWrapper+0x46/0x60 [vboxdrv]
 [<ffffffffc0540290>] ? VBoxHost_RTMpGetOnlineSet+0x70/0x70 [vboxdrv]
 [<ffffffff81105225>] flush_smp_call_function_queue+0x85/0x150
 [<ffffffff81105e93>] generic_smp_call_function_single_interrupt+0x13/0x60
 [<ffffffff81050767>] smp_call_function_interrupt+0x27/0x40
 [<ffffffff817f07be>] call_function_interrupt+0x6e/0x80
 <EOI>  [<ffffffff8167c1b9>] ? cpuidle_enter_state+0xa9/0x260
 [<ffffffff8167c188>] ? cpuidle_enter_state+0x78/0x260
 [<ffffffff8167c3a7>] cpuidle_enter+0x17/0x20
 [<ffffffff810c4a6c>] cpu_startup_entry+0x39c/0x4f0
 [<ffffffff817da6ba>] rest_init+0x8a/0x90
 [<ffffffff81d530f7>] start_kernel+0x495/0x4a2
 [<ffffffff81d52a52>] ? set_init_arg+0x55/0x55
 [<ffffffff81d52120>] ? early_idt_handler_array+0x120/0x120
 [<ffffffff81d525ee>] x86_64_start_reservations+0x2a/0x2c
 [<ffffffff81d5272d>] x86_64_start_kernel+0x13d/0x14c
CPU: 7 PID: 0 Comm: swapper/7 Tainted: G        W  OE   4.1.13-rt15+ #3
Hardware name: Dell Inc. OptiPlex 9020/0PC5F7, BIOS A03 09/17/2013
 0000000000018000 ffff88021ebc3d78 ffffffff817e8319 0000000000010003
 ffff88021ebd8000 ffff88021ebc3d88 ffffffff817e4425 ffff88021ebc3dd8
 ffffffff817ebdcb ffff88021ebc3df8 ffff880214a8a190 0000000000000000
Call Trace:
 <IRQ>  [<ffffffff817e8319>] dump_stack+0x4a/0x61
 [<ffffffff817e4425>] __schedule_bug+0x9d/0xab
 [<ffffffff817ebdcb>] __schedule+0x7cb/0x920
 [<ffffffff817ebf5f>] schedule+0x3f/0xd0
 [<ffffffff817eda1d>] rt_spin_lock_slowlock+0xbd/0x1f0
 [<ffffffff817eee45>] rt_spin_lock+0x25/0x30
 [<ffffffffc05428ee>] VBoxHost_RTSpinlockAcquire+0x5e/0x70 [vboxdrv]
 [<ffffffffc05347c1>] supdrvGipMpEventOnlineOrInitOnCpu+0x61/0x2c0 [vboxdrv]
 [<ffffffffc0534bd5>] supdrvGipInitOnCpu+0x15/0x20 [vboxdrv]
 [<ffffffffc05402d6>] rtmpLinuxAllWrapper+0x46/0x60 [vboxdrv]
 [<ffffffffc0540290>] ? VBoxHost_RTMpGetOnlineSet+0x70/0x70 [vboxdrv]
 [<ffffffff81105225>] flush_smp_call_function_queue+0x85/0x150
 [<ffffffff81105e93>] generic_smp_call_function_single_interrupt+0x13/0x60
 [<ffffffff81050767>] smp_call_function_interrupt+0x27/0x40
 [<ffffffff817f07be>] call_function_interrupt+0x6e/0x80
 <EOI>  [<ffffffff8167c1b9>] ? cpuidle_enter_state+0xa9/0x260
 [<ffffffff8167c188>] ? cpuidle_enter_state+0x78/0x260
 [<ffffffff8167c3a7>] cpuidle_enter+0x17/0x20
 [<ffffffff810c4a6c>] cpu_startup_entry+0x39c/0x4f0
 [<ffffffff8105124f>] start_secondary+0x16f/0x190
vboxdrv: TSC mode is Invariant, tentative frequency 3392138874 Hz
vboxdrv: Successfully loaded version 5.0.10_Ubuntu (interface 0x00240000)
VBoxNetFlt: Successfully started.
VBoxNetAdp: Successfully started.
VBoxPciLinuxInit
vboxpci: IOMMU not found (not registered)
The problem seems to be related to the real-time kernel since the message does not appear with the same version of kernel without the real-time patch. However, it happens while loading vboxdrv, so VirtualBox developers should be IMHO able to fix it. Should I file a bug report for VirtualBox or would you recommend something else?