Re: mce.c related WARNING: at kernel/timer.c:983 del_timer_sync

From: Yong Zhang
Date: Tue Mar 08 2011 - 04:07:07 EST


On Tue, Mar 8, 2011 at 9:31 AM, Venkatesh Pallipadi <venki@xxxxxxxxxx> wrote:
> With latest git kernel, I see the below WARN_ON at boot, once for each CPU.
>
> [ Â 26.806429] ------------[ cut here ]------------
> [ Â 26.806434] WARNING: at kernel/timer.c:983 del_timer_sync+0x39/0x4d()
> [ Â 26.806437] Hardware name: MCP55
> [ Â 26.806438] Modules linked in: tg3 forcedeth sata_mv powernow_k8
> freq_table processor mperf msr cpuid ipv6 genrtc
> [ Â 26.806447] Pid: 0, comm: swapper Tainted: G Â Â Â ÂW
> 2.6.38-smp-linus.22280 #23
> [ Â 26.806449] Call Trace:
> [ Â 26.806450] Â<IRQ> Â[<ffffffff8106e8ea>] ? warn_slowpath_common+0x85/0x9d
> [ Â 26.806456] Â[<ffffffff8106e91c>] ? warn_slowpath_null+0x1a/0x1c
> [ Â 26.806459] Â[<ffffffff8107ac48>] ? del_timer_sync+0x39/0x4d
> [ Â 26.806462] Â[<ffffffff81047a44>] ? mce_cpu_restart+0x1e/0x54
> [ Â 26.806466] Â[<ffffffff81099b22>] ?
> generic_smp_call_function_single_interrupt+0xd1/0xf3
> [ Â 26.806469] Â[<ffffffff8104c188>] ?
> smp_call_function_single_interrupt+0x18/0x27
> [ Â 26.806473] Â[<ffffffff810375f3>] ? call_function_single_interrupt+0x13/0x20
> [ Â 26.806475] Â<EOI> Â[<ffffffff8103da93>] ? default_idle+0x4d/0x7f
> [ Â 26.806479] Â[<ffffffff8103da73>] ? default_idle+0x2d/0x7f
> [ Â 26.806482] Â[<ffffffff8103dbad>] ? c1e_idle+0xe8/0xef
> [ Â 26.806485] Â[<ffffffff8145bc62>] ? atomic_notifier_call_chain+0x18/0x1a
> [ Â 26.806488] Â[<ffffffff81035cc7>] ? cpu_idle+0x5f/0x96
> [ Â 26.806491] Â[<ffffffff8144af7e>] ? rest_init+0x72/0x74
> [ Â 26.806495] Â[<ffffffff818edcfe>] ? start_kernel+0x37b/0x386
> [ Â 26.806498] Â[<ffffffff818ed2a4>] ? x86_64_start_reservations+0xb4/0xb8
> [ Â 26.806502] Â[<ffffffff818ed39a>] ? x86_64_start_kernel+0xf2/0xf9
> [ Â 26.806504] ---[ end trace 69a4de56993e518a ]---
>
> Looks like WARN_ON was after this change
> commit 466bd3030973910118ca601da8072be97a1e2209
> Author: Yong Zhang <yong.zhang@xxxxxxxxxxxxx>
> Date: Â Wed Oct 20 15:57:33 2010 -0700
>
> Â Âtimer: Warn when del_timer_sync() is called in hardirq context

Even if without the WARN_ON(), lockdep will shout on it :)

>
> But, the actual reason is likely some MCE parameter change at boot causing
> mce_restart() which in turn calls on_each_cpu mce_cpu_restart() which calls
> del_timer_sync().

Seems we found a real bug.

And usage of del_timer_sync() in arch/x86/kernel/cpu/mcheck/mce.c
break two restriction:
1) del_timer_sync() must not be used in interrupt context;
2) The timer's handler must not call add_timer_on();

Thanks,
Yong

--
Only stand for myself
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/