From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <55267832.7010804@siemens.com> References: <20150313171211.GH1497@hermes.click-hack.org> <20150402191555.GK31175@hermes.click-hack.org> <20150402204139.GL31175@hermes.click-hack.org> <55264097.2010203@siemens.com> <5526430E.8030808@siemens.com> <20150409124110.GY20752@hermes.click-hack.org> <55267547.7080206@siemens.com> <20150409125838.GA20752@hermes.click-hack.org> <55267832.7010804@siemens.com> Date: Tue, 21 Apr 2015 23:14:26 +0200 Message-ID: From: Jeroen Van den Keybus Content-Type: text/plain; charset=UTF-8 Subject: Re: [Xenomai] xeno3_rc3 - Watchdog detected hard LOCKUP List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: "xenomai@xenomai.org" Sorry to tell, but it happened again after 181 hours. Of course, we can try to disable APEI (but not in BIOS AFAICT) but maybe it's better to find the root cause. I double checked that the patch is included in this kernel. The disassembly shows it's there allright. Hope you can make more out of it. ... if (!pte) return -ENOMEM; do { BUG_ON(!pte_none(*pte)); 39efb0: 0f 0b ud2 39efb2: bb f4 ff ff ff mov $0xfffffff4,%ebx * We mask the PREEMPT_NEED_RESCHED bit so as not to confuse all current users * that think a non-zero value indicates we cannot preempt. */ static __always_inline int preempt_count(void) { return raw_cpu_read_4(__preempt_count) & ~PREEMPT_NEED_RESCHED; 39efb7: 65 8b 04 25 00 00 00 mov %gs:0x0,%eax 39efbe: 00 break; } while (pgd++, addr = next, addr != end); /* APEI may invoke this for temporarily remapping pages in IRQ or NMI * context - nothing we can and need to propagate globally. */ if (!(in_irq() || in_nmi())) { 39efbf: a9 00 00 0f 00 test $0xf0000,%eax 39efc4: 75 14 jne 39efda 39efc6: a9 00 00 10 00 test $0x100000,%eax 39efcb: 75 0d jne 39efda __ipipe_pin_range_globally(start, end); 39efcd: 48 8b 75 b0 mov -0x50(%rbp),%rsi 39efd1: 48 8b 7d a8 mov -0x58(%rbp),%rdi 39efd5: e8 00 00 00 00 callq 39efda flush_cache_vmap(start, end); } return err; } ... [655067.225172] Kernel panic - not syncing: Watchdog detected hard LOCKUP on cpu 3 [655067.225199] CPU: 3 PID: 22233 Comm: dohell Not tainted 3.16.7-cobalt #2 [655067.225216] Hardware name: Supermicro X10SAE/X10SAE, BIOS 2.0a 05/09/2014 [655067.225233] 0000000000000000 ffff88021fb86c38 ffffffff8175761d ffffffff81a8a1e8 [655067.225257] ffff88021fb86cb0 ffffffff81752c0e 0000000000000010 ffff88021fb86cc0 [655067.225281] ffff88021fb86c60 0000000000000000 0000000000000003 0000000000028012 [655067.225305] Call Trace: [655067.225312] [] dump_stack+0x45/0x56 [655067.225334] [] panic+0xd8/0x20a [655067.225350] [] watchdog_overflow_callback+0xc2/0xd0 [655067.225367] [] __perf_event_overflow+0x8d/0x230 [655067.225383] [] perf_event_overflow+0x14/0x20 [655067.225400] [] intel_pmu_handle_irq+0x1e6/0x400 [655067.225417] [] ? unmap_kernel_range_noflush+0x11/0x20 [655067.225435] [] perf_event_nmi_handler+0x2b/0x50 [655067.225452] [] nmi_handle+0x88/0x120 [655067.225466] [] default_do_nmi+0x49/0x130 [655067.225481] [] do_nmi+0xd0/0xf0 [655067.225495] [] end_repeat_nmi+0x1e/0x2e [655067.225510] [] ? _raw_spin_lock+0x2d/0x40 [655067.225525] [] ? _raw_spin_lock+0x2d/0x40 [655067.225539] [] ? _raw_spin_lock+0x2d/0x40 [655067.225553] <> [] __ipipe_pin_range_globally+0x7c/0x2b0 [655067.225576] [] ? ipipe_restore_root+0x31/0x40 [655067.225592] [] ? get_page_from_freelist+0x523/0x910 [655067.225609] [] ioremap_page_range+0x21a/0x300 [655067.225625] [] ? update_curr+0x80/0x180 [655067.225640] [] ghes_copy_tofrom_phys+0x1e9/0x200 [655067.225657] [] ? ghes_irq_func+0x20/0x20 [655067.225672] [] ghes_read_estatus+0x80/0x160 [655067.225687] [] ghes_proc+0x14/0x80 [655067.225803] [] ghes_poll_func+0x12/0x30 [655067.225869] [] call_timer_fn+0x36/0x100 [655067.225884] [] ? ghes_irq_func+0x20/0x20 [655067.225899] [] run_timer_softirq+0x208/0x2f0 [655067.225915] [] __do_softirq+0xe5/0x290 [655067.225929] [] ? do_IRQ+0x100/0x100 [655067.225943] [] irq_exit+0xbd/0xd0 [655067.226006] [] smp_apic_timer_interrupt+0x35/0x50 [655067.226023] [] __ipipe_do_IRQ+0x79/0x90 [655067.226037] [] ? do_IRQ+0x100/0x100 [655067.226050] [] ? __ipipe_do_IRQ+0x7f/0x90 [655067.226116] [] __ipipe_do_sync_stage+0x169/0x170 [655067.226132] [] __ipipe_do_sync_pipeline+0x9d/0xa0 [655067.226147] [] __ipipe_dispatch_irq+0x188/0x2a0 [655067.226163] [] __ipipe_handle_irq+0x65/0x180 [655067.226179] [] apic_timer_interrupt+0x60/0x90 [655067.226194] [] ? _raw_spin_lock+0x12/0x40 [655067.226210] [] ? __get_free_pages+0xe/0x50 [655067.226225] [] pgd_alloc+0x38/0x1c0 [655067.226239] [] mm_init+0xfa/0x150 [655067.226304] [] mm_alloc+0x70/0xf0 [655067.226318] [] do_execve_common.isra.24+0x1ce/0x650 [655067.226334] [] ? getname_flags+0x50/0x1a0 [655067.226349] [] SyS_execve+0x29/0x30 [655067.226362] [] stub_execve+0x69/0xa0 [655067.226378] Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffff9fffffff) [655067.226402] drm_kms_helper: panic occurred, switching back to text console Jeroen. 2015-04-09 15:01 GMT+02:00 Jan Kiszka : > On 2015-04-09 14:58, Gilles Chanteperdrix wrote: >> On Thu, Apr 09, 2015 at 02:49:11PM +0200, Jan Kiszka wrote: >>> On 2015-04-09 14:41, Gilles Chanteperdrix wrote: >>>> On Thu, Apr 09, 2015 at 11:14:54AM +0200, Jan Kiszka wrote: >>>>> On 2015-04-09 11:04, Jan Kiszka wrote: >>>>>> On 2015-04-08 23:02, Jeroen Van den Keybus wrote: >>>>>>> It took a while, but a hard lockup occurred on Xenomai 3.0-rc4 with >>>>>>> Linux 3.16.7 running dohell. This time, I believe I have a trace of >>>>>>> the locked up CPU. It's listed below and for completeness, the first >>>>>>> part of the dmesg log is attached as well. >>>>>>> >>>>>>> [419215.683857] Kernel panic - not syncing: Watchdog detected hard >>>>>>> LOCKUP on cpu 3 >>>>>>> [419215.683886] CPU: 3 PID: 18835 Comm: dohell Not tainted 3.16.7-cobalt #1 >>>>>>> [419215.683903] Hardware name: Supermicro X10SAE/X10SAE, BIOS 2.0a 05/09/2014 >>>>>>> [419215.683920] 0000000000000000 ffff88021fb86c38 ffffffff8175761d >>>>>>> ffffffff81a8a1e8 >>>>>>> [419215.683945] ffff88021fb86cb0 ffffffff81752c0e 0000000000000010 >>>>>>> ffff88021fb86cc0 >>>>>>> [419215.683968] ffff88021fb86c60 0000000000000000 0000000000000003 >>>>>>> 000000000001999e >>>>>>> [419215.684095] Call Trace: >>>>>>> [419215.684103] [] dump_stack+0x45/0x56 >>>>>>> [419215.684125] [] panic+0xd8/0x20a >>>>>>> [419215.684141] [] watchdog_overflow_callback+0xc2/0xd0 >>>>>>> [419215.684158] [] __perf_event_overflow+0x8d/0x230 >>>>>>> [419215.684174] [] perf_event_overflow+0x14/0x20 >>>>>>> [419215.684190] [] intel_pmu_handle_irq+0x1e6/0x400 >>>>>>> [419215.684259] [] ? unmap_kernel_range_noflush+0x11/0x20 >>>>>>> [419215.684277] [] perf_event_nmi_handler+0x2b/0x50 >>>>>>> [419215.684293] [] nmi_handle+0x88/0x120 >>>>>>> [419215.684308] [] default_do_nmi+0xce/0x130 >>>>>>> [419215.684373] [] do_nmi+0xd0/0xf0 >>>>>>> [419215.684387] [] end_repeat_nmi+0x1e/0x2e >>>>>>> [419215.684402] [] ? _raw_spin_lock+0x2a/0x40 >>>>>>> [419215.684417] [] ? _raw_spin_lock+0x2a/0x40 >>>>>>> [419215.684431] [] ? _raw_spin_lock+0x2a/0x40 >>>>>>> [419215.684445] <> [] >>>>>>> __ipipe_pin_range_globally+0x7c/0x2b0 >>>>>>> [419215.684468] [] ioremap_page_range+0x226/0x300 >>>>>>> [419215.684485] [] ? xnintr_core_clock_handler+0x2ea/0x310 >>>>>>> [419215.684553] [] ? update_curr+0x80/0x180 >>>>>>> [419215.684568] [] ghes_copy_tofrom_phys+0x1e9/0x200 >>>>>> >>>>>> OK, maybe it is related to ACPI APEI, maybe that is just triggering an >>>>>> I-pipe bug. But could you try to disable that feature and see if the >>>>>> issue still appears? >>>>>> >>>>>> I'll meanwhile dig deeper and try to understand what could cause a lockup. >>>>> >>>>> Oh, the bug is obvious (and would have been reported when turning on >>>>> CONFIG_PROVE_LOCKING): We are calling __ipipe_pin_range_globally from >>>>> IRQ context here, but that only uses spin_lock. >>>> >>>> ipipe_pin_range_globally is called in case of vmalloc or ioremap. Is >>>> there really any code which calls vmalloc or ioremap from irq >>>> context ? I doubt that very much. >>> >>> Just need to look at the backtrace. >> >> Is the mapping done this way permanent, or just temporary, for the >> duration of the irq ? Because if done temporarily, we might as >> well just skip ipipe_pin_range_globally in this case: the mm context >> is not going to change under an irq handler's feet. > > I strongly suspect it is the same kind of mapping we already exclude > with the NMI test: temporary. But I still need to look at the details. > > Converting all pgd_lock into irqsave would also mean including all > pgt_lock sites, and I have a bad feeling about potential side effects of > such changes, at least on the long-term. > > Jan > > -- > Siemens AG, Corporate Technology, CT RTC ITP SES-DE > Corporate Competence Center Embedded Linux