4.14 IPIPE kernel results - Interesting bug?
A message that is not in the archive (sent off-list or not yet received): [email protected]
$ testsuite/smokey/smokey --verbose=9 --trace=9 -- cold init from program -- memcheck->tune() -- cobalt->init() -- connected to Cobalt -- memory locked -- memory heaps mapped -- boilerplate->init() -- copperplate->init() -- smokey->init() -- program bootstrap done No crash, all seems fine?
After running xeno-test though:
[ 255.675666] I-pipe: Detected stalled head domain, probably caused by a bug.
A critical section may have been left unterminated.
[ 255.675670] DEBUG_LOCKS_WARN_ON(preemptible())
[ 255.675678] BUG: using __this_cpu_write() in preemptible [00000000] code: InputThread/830
[ 255.675684] caller is do_vprintk+0x56/0x100
[ 255.675688] CPU: 0 PID: 830 Comm: InputThread Not tainted 4.14.77-IPIPE+ #3
[ 255.675689] I-pipe domain: Linux
[ 255.675692] Call Trace:
[ 255.675695] <IRQ>
[ 255.675699] ? dump_stack+0x6f/0x87
[ 255.675703] ? check_preemption_disabled+0x110/0x120
[ 255.675706] ? do_vprintk+0x56/0x100
[ 255.675709] ? printk+0x43/0x45
[ 255.675712] ? ipipe_root_only+0xd7/0xe0
[ 255.675715] ? ipipe_stall_root+0x7/0x30
[ 255.675718] ? __ipipe_trap_prologue+0x215/0x240
[ 255.675721] ? invalid_op+0x2a/0x55
[ 255.675725] ? __switch_to_xtra+0x34b/0x370
[ 255.675728] ? __switch_to_asm+0x34/0x70
[ 255.675730] ? __switch_to_asm+0x40/0x70
[ 255.675733] ? __switch_to+0x306/0x340
[ 255.675735] ? __switch_to_asm+0x40/0x70
[ 255.675739] ? ___xnsched_run+0x155/0x3e0
[ 255.675741] ? xnintr_core_clock_handler+0x24b/0x260
[ 255.675744] ? dispatch_irq_head+0x90/0x130
[ 255.675747] ? __ipipe_handle_irq+0x6e/0x1f0
[ 255.675750] ? apic_timer_interrupt+0x77/0xa0
[ 255.675751] </IRQ>
[ 255.675756] ? ep_send_events_proc+0xa9/0x180
[ 255.675758] ? ep_send_events_proc+0x9c/0x180
[ 255.675761] ? ep_poll+0x470/0x470
[ 255.675764] ? ep_scan_ready_list.isra.18+0x98/0x1e0
[ 255.675767] ? ep_poll+0x23a/0x470
[ 255.675770] ? try_to_wake_up+0x350/0x350
[ 255.675773] ? SyS_epoll_wait+0xad/0xd0
[ 255.675775] ? do_syscall_64+0x8a/0x27d
[ 255.675778] ? __do_page_fault+0x17c/0x3e0
[ 255.675781] ? entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[ 255.675785] CPU: 0 PID: 830 Comm: InputThread Not tainted 4.14.77-IPIPE+ #3
[ 255.675787] I-pipe domain: Linux
[ 255.675789] Call Trace:
[ 255.675791] <IRQ>
[ 255.675795] ? dump_stack+0x6f/0x87
[ 255.675798] ? ipipe_stall_root+0x7/0x30
[ 255.675800] ? __ipipe_trap_prologue+0x215/0x240
[ 255.675804] ? invalid_op+0x2a/0x55
[ 255.675808] ? __switch_to_xtra+0x34b/0x370
[ 255.675811] ? __switch_to_asm+0x34/0x70
[ 255.675814] ? __switch_to_asm+0x40/0x70
[ 255.675817] ? __switch_to+0x306/0x340
[ 255.675820] ? __switch_to_asm+0x40/0x70
[ 255.675823] ? ___xnsched_run+0x155/0x3e0
[ 255.675827] ? xnintr_core_clock_handler+0x24b/0x260
[ 255.675830] ? dispatch_irq_head+0x90/0x130
[ 255.675833] ? __ipipe_handle_irq+0x6e/0x1f0
[ 255.675837] ? apic_timer_interrupt+0x77/0xa0
[ 255.675839] </IRQ>
[ 255.675843] ? ep_send_events_proc+0xa9/0x180
[ 255.675847] ? ep_send_events_proc+0x9c/0x180
[ 255.675850] ? ep_poll+0x470/0x470
[ 255.675853] ? ep_scan_ready_list.isra.18+0x98/0x1e0
[ 255.675857] ? ep_poll+0x23a/0x470
[ 255.675861] ? try_to_wake_up+0x350/0x350
[ 255.675864] ? SyS_epoll_wait+0xad/0xd0
[ 255.675867] ? do_syscall_64+0x8a/0x27d
[ 255.675870] ? __do_page_fault+0x17c/0x3e0
[ 255.675874] ? entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[ 255.675880] BUG: Unhandled exception over domain Xenomai at 0xffffffffb1c0f2db - switching to ROOT
[ 255.675882] CPU: 0 PID: 830 Comm: InputThread Not tainted 4.14.77-IPIPE+ #3
[ 255.675884] I-pipe domain: Linux
[ 255.675886] Call Trace:
[ 255.675888] <IRQ>
[ 255.675891] ? dump_stack+0x6f/0x87
[ 255.675894] ? __ipipe_trap_prologue+0x18a/0x240
[ 255.675898] ? invalid_op+0x2a/0x55
[ 255.675902] ? __switch_to_xtra+0x34b/0x370
[ 255.675905] ? __switch_to_asm+0x34/0x70
[ 255.675908] ? __switch_to_asm+0x40/0x70
[ 255.675911] ? __switch_to+0x306/0x340
[ 255.675913] ? __switch_to_asm+0x40/0x70
[ 255.675917] ? ___xnsched_run+0x155/0x3e0
[ 255.675920] ? xnintr_core_clock_handler+0x24b/0x260
[ 255.675923] ? dispatch_irq_head+0x90/0x130
[ 255.675926] ? __ipipe_handle_irq+0x6e/0x1f0
[ 255.675930] ? apic_timer_interrupt+0x77/0xa0
[ 255.675932] </IRQ>
[ 255.675937] ? ep_send_events_proc+0xa9/0x180
[ 255.675940] ? ep_send_events_proc+0x9c/0x180
[ 255.675943] ? ep_poll+0x470/0x470
[ 255.675947] ? ep_scan_ready_list.isra.18+0x98/0x1e0
[ 255.675950] ? ep_poll+0x23a/0x470
[ 255.675954] ? try_to_wake_up+0x350/0x350
[ 255.675957] ? SyS_epoll_wait+0xad/0xd0
[ 255.675960] ? do_syscall_64+0x8a/0x27d
[ 255.675963] ? __do_page_fault+0x17c/0x3e0
[ 255.675967] ? entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[ 255.675973] ------------[ cut here ]------------
[ 255.675977] WARNING: CPU: 0 PID: 830 at ./arch/x86/include/asm/desc.h:312 __switch_to_xtra+0x34b/0x370
[ 255.675979] Modules linked in: af_packet nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables hid_generic usbhid hid nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack iptable_filter ohci_pci xhci_pci xhci_hcd ohci_hcd ehci_pci r8169 ehci_hcd usbcore rtc_cmos usb_common mii ip_tables x_tables ipv6 [ 255.676022] CPU: 0 PID: 830 Comm: InputThread Not tainted 4.14.77-IPIPE+ #3
[ 255.676024] I-pipe domain: Linux
[ 255.676026] task: ffff9f222e352600 task.stack: ffffb21d80878000
[ 255.676029] RIP: 0010:__switch_to_xtra+0x34b/0x370
[ 255.676032] RSP: 0018:ffff9f223fc03e70 EFLAGS: 00010046
[ 255.676036] RAX: 0000000000000023 RBX: 0000000000400000 RCX: 0000000000000001
[ 255.676038] RDX: 0000000000000000 RSI: 0000000000001140 RDI: 0000000000000045
[ 255.676046] RBP: ffff9f223fc03e98 R08: 0000000000000000 R09: ffffffffb2730894
[ 255.676053] R10: 000000000000000d R11: ffffb21d828fbcb0 R12: 0000000000000000
[ 255.676059] R13: ffff9f223fc00000 R14: 0000000000000000 R15: 0000000000004000
[ 255.676066] FS: 0000766ce8c47700(0000) GS:ffff9f223fc00000(0000) knlGS:0000000000000000
[ 255.676072] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 255.676078] CR2: 000070981d8ae000 CR3: 0000000427f8c000 CR4: 00000000000406f0
[ 255.676085] Call Trace:
[ 255.676091] <IRQ>
[ 255.676098] ? __switch_to_asm+0x34/0x70
[ 255.676104] ? __switch_to_asm+0x40/0x70
[ 255.676112] ? __switch_to+0x306/0x340
[ 255.676119] ? __switch_to_asm+0x40/0x70
[ 255.676128] ? ___xnsched_run+0x155/0x3e0
[ 255.676137] ? xnintr_core_clock_handler+0x24b/0x260
[ 255.676145] ? dispatch_irq_head+0x90/0x130
[ 255.676154] ? __ipipe_handle_irq+0x6e/0x1f0
[ 255.676163] ? apic_timer_interrupt+0x77/0xa0
[ 255.676169] </IRQ>
[ 255.676180] ? ep_send_events_proc+0xa9/0x180
[ 255.676188] ? ep_send_events_proc+0x9c/0x180
[ 255.676196] ? ep_poll+0x470/0x470
[ 255.676205] ? ep_scan_ready_list.isra.18+0x98/0x1e0
[ 255.676215] ? ep_poll+0x23a/0x470
[ 255.676225] ? try_to_wake_up+0x350/0x350
[ 255.676234] ? SyS_epoll_wait+0xad/0xd0
[ 255.676242] ? do_syscall_64+0x8a/0x27d
[ 255.676249] ? __do_page_fault+0x17c/0x3e0
[ 255.676259] ? entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[ 255.676270] Code: 00 85 c0 0f 84 3a fd ff ff 83 3d 40 01 c2 00 00 0f 85 2d fd ff ff 48 c7 c6 85 72 49 b2 48 c7 c7 93 72 49 b2 31 c0 e8 1d e6 05 00 <0f> 0b e9 11 fd ff ff 44 89 ef e8 86 41 00 00 ba 01 00 00 00 eb
[ 255.676568] ---[ end trace 7e0ca3fbc0d12858 ]---
No panic, system still works, and I am still able to run the latency test:
$ testsuite/latency/latency == Sampling period: 100 us == Test mode: periodic user-mode task == All results in microseconds warming up... RTT| 00:00:01 (periodic user-mode task, 100 us period, priority 99) RTH|----lat min|----lat avg|----lat max|-overrun|---msw|---lat best|--lat worst RTD| 1.878| 2.452| 7.241| 0| 0| 1.878| 7.241 RTD| 1.732| 2.461| 8.425| 0| 0| 1.732| 8.425 RTD| 2.209| 2.468| 9.690| 0| 0| 1.732| 9.690 RTD| 1.648| 2.542| 7.852| 0| 0| 1.648| 9.690 RTD| 1.855| 2.553| 6.707| 0| 0| 1.648| 9.690 RTD| 1.824| 2.462| 7.941| 0| 0| 1.648| 9.690 RTD| 1.843| 2.459| 7.572| 0| 0| 1.648| 9.690 RTD| 2.207| 2.460| 6.236| 0| 0| 1.648| 9.690 RTD| 2.210| 2.464| 6.737| 0| 0| 1.648| 9.690 RTD| 1.901| 2.485| 7.725| 0| 0| 1.648| 9.690 RTD| 1.991| 2.500| 8.209| 0| 0| 1.648| 9.690 RTD| 1.535| 2.557| 8.802| 0| 0| 1.535| 9.690 RTD| 1.787| 2.482| 8.473| 0| 0| 1.535| 9.690 RTD| 1.824| 2.467| 8.610| 0| 0| 1.535| 9.690 RTD| 2.211| 2.464| 7.443| 0| 0| 1.535| 9.690 RTD| 1.899| 2.457| 7.934| 0| 0| 1.535| 9.690 RTD| 2.210| 2.460| 7.942| 0| 0| 1.535| 9.690 RTD| 2.206| 2.451| 5.614| 0| 0| 1.535| 9.690 RTD| 1.614| 2.583| 7.802| 0| 0| 1.535| 9.690 RTD| 1.854| 2.549| 7.202| 0| 0| 1.535| 9.690 ^C---|-----------|-----------|-----------|--------|------|------------------------- RTS| 1.535| 2.488| 9.690| 0| 0| 00:00:20/00:00:20
Using Xenomai branch next.
Cheers!
Alec
I modified my kernel config some, this is what I have now:
[ 348.421965] DEBUG_LOCKS_WARN_ON(preemptible())
[ 348.421966] BUG: Unhandled exception over domain Xenomai at 0xffffffff9340e9f2 - switching to ROOT
[ 348.421968] CPU: 0 PID: 599 Comm: X Not tainted 4.14.77-IPIPE+ #7
[ 348.421969] I-pipe domain: Linux
[ 348.421970] Call Trace:
[ 348.421970] <IRQ>
[ 348.421971] ? dump_stack+0x8d/0xa7
[ 348.421971] ? __ipipe_trap_prologue+0x188/0x220
[ 348.421972] ? invalid_op+0x2a/0x55
[ 348.421973] ? __switch_to_xtra+0x352/0x370
[ 348.421973] ? __switch_to_xtra+0x352/0x370
[ 348.421974] ? __switch_to+0x306/0x340
[ 348.421974] ? ___xnsched_run+0x1c0/0x340
[ 348.421975] ? xnintr_core_clock_handler+0x1d9/0x1f0
[ 348.421976] ? dispatch_irq_head+0x6e/0xf0
[ 348.421976] ? __ipipe_handle_irq+0x7d/0x1c0
[ 348.421977] ? apic_timer_interrupt+0x77/0xa0
[ 348.421978] </IRQ>
[ 348.421978] ------------[ cut here ]------------
[ 348.421979] WARNING: CPU: 0 PID: 599 at ./arch/x86/include/asm/desc.h:312 __switch_to_xtra+0x352/0x370
[ 348.421980] Modules linked in: mousedev evdev hid_generic usbhid hid ohci_pci ehci_pci ohci_hcd xhci_pci xhci_hcd ehci_hcd usbcore r8169 usb_common mii rtc_cmos
[ 348.421987] CPU: 0 PID: 599 Comm: X Not tainted 4.14.77-IPIPE+ #7
[ 348.421988] I-pipe domain: Linux
[ 348.421988] task: ffff912b6a51cd40 task.stack: ffff912b6e1bc000
[ 348.421989] RIP: 0010:__switch_to_xtra+0x352/0x370
[ 348.421990] RSP: 0018:ffff912b7fc03eb8 EFLAGS: 00010046
[ 348.421991] RAX: 0000000000000023 RBX: 0000000000400000 RCX: 0000000000000001
[ 348.421991] RDX: ffff912b7fc00000 RSI: 0000000000001140 RDI: ffffffff93f50200
[ 348.421992] RBP: ffff912b7fc03ee0 R08: 0000000000000045 R09: ffffffff93f2c594
[ 348.421993] R10: 000000000000000d R11: 0000000000000000 R12: 0000000000000000
[ 348.421994] R13: ffff912b7fc00000 R14: 0000000000000000 R15: 0000000000004000
[ 348.421994] FS: 000073d4b64cea40(0000) GS:ffff912b7fc00000(0000) knlGS:0000000000000000
[ 348.421995] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 348.421996] CR2: 00007360a5117000 CR3: 000000042e01e000 CR4: 00000000000406b0
[ 348.421996] Call Trace:
[ 348.421997] <IRQ>
[ 348.421997] ? __switch_to+0x306/0x340
[ 348.421998] ? ___xnsched_run+0x1c0/0x340
[ 348.421999] ? xnintr_core_clock_handler+0x1d9/0x1f0
[ 348.421999] ? dispatch_irq_head+0x6e/0xf0
[ 348.422000] ? __ipipe_handle_irq+0x7d/0x1c0
[ 348.422001] ? apic_timer_interrupt+0x77/0xa0
[ 348.422001] </IRQ>
[ 348.422002] Code: 00 85 c0 0f 84 33 fd ff ff 83 3d 89 b5 c1 00 00 0f 85 26 fd ff ff 48 c7 c6 ed 57 c9 93 48 c7 c7 fb 57 c9 93 31 c0 e8 96 6e 05 00 <0f> 0b e9 0a fd ff ff 44 89 ef e8 6f 40 00 00 ba 01 00 00 00 eb [ 348.422026] ---[ end trace 28752ae954ec2587 ]---
A shorter stack trace than the one I posted earlier, with this kernel being trimmed down further (less debugging, etc.)
Also, I know this is irrelevant, but this shouldn't happen as HPET and PMTIMER are both enabled:
[ 0.000000] tsc: Fast TSC calibration failed
[ 0.000000] tsc: Unable to calibrate against PIT
[ 0.000000] tsc: No reference (HPET/PMTIMER) available
TSC calibration works just fine on non-IPIPE kernel, I've never seen "No reference (HPET/PMTIMER) available" before.
"tsc: Unable to calibrate against PIT" yeah that's pretty common, but TSC calibration would always fallback to HPET. PMTIMER should also be seen as available.
I'm just trying to help the team, if you need anything else, let me know. I'm from RTAI and I've never seen a trace which points to __switch_to_xtra before either. Do you know anything about this? Thanks everyone, this community is pretty awesome! Cheers!
Alec
Using the server preemption model (CONFIG_PREEMPT_NONE) seemed to have fixed it. I am unable to reproduce the stack trace, using either Xenomai branches (master or next)
It might be best to blacklist CONFIG_PREEMPT (and maybe CONFIG_PREEMPT_VOLUNTARY as well) until this problem is fixed.
I would suggest using !XENOMAI instead of !IPIPE when modifying kernel/Kconfig.preempt as using CONFIG_PREEMPT is a Xenomai-specific bug, not an issue directly related to IPIPE itself. CONFIG_PREEMPT does not cause problems with RTAI. The trace only appears when running the Xenomai latency test (~/xenomai/testsuite/latency/latency) and xeno-test (/usr/xenomai/bin/xeno-test)
Cheers!
Alec