Re: [PATCH 1/8] x86, mce: stop calling del_timer_sync() frominterrupt

From: Borislav Petkov
Date: Fri Aug 26 2011 - 06:50:34 EST


On Fri, Jun 17, 2011 at 04:40:36AM -0400, Hidetoshi Seto wrote:
> Function del_timer_sync() has WARN_ON(in_irq()) in it because
> calling it from interrupt context can cause deadlock if it
> interrupts the target timer running.
>
> In MCE code, del_timer_sync() is used with on_each_cpu() in
> some parts for sysfs files:
> bank*, check_interval, cmci_disabled and ignore_ce.
>
> However use of on_each_cpu() results in calling the function
> passed as the argument in the interrupt context. It means you
> can see a flood of warnings from del_timer_sync() by a simple
> file access, for example:
>
> echo 300 > /sys/devices/system/machinecheck/machinecheck0/check_interval
>
> Fortunately these MCE specific files are rare-used and AFAIK
> only few MCE geeks experience this warning on write.
>
> To remove the warning (for my happy hacking), move timer deletion
> outside of the interrupt context ;-)

I'm hitting this warning too in my testing here so I'd like to expedite
this patch going in. I'll send the version below upstream next week if
there are no objections:

--