Re: [PATCH 07/14] mce3: pass mce info to EDAC for decoding

Andi Kleen
2009-07-21T06:51:35Z

On Tue, Jul 21, 2009 at 12:41:34PM +0900, Hidetoshi Seto wrote:
> H. Peter Anvin wrote:
> > If you want modules to change the behavior, you're talking about a
> > *dynamic* change -- the call will point to different things at different
> > points in time -- so you need another mechanism, i.e. function pointers.
>
> Just FYI, machine check handler on ia64 has such function pointer.
>
> [arch/ia64/kernel/mca.c]
> 826 /* Function pointer for extra MCA recovery */
> 827 int (*ia64_mca_ucmc_extension)
> 828 (void*,struct ia64_sal_os_state*)
> 829 = NULL;

A notifier would be a much more flexible solution. Function pointers
don't really work well with multiple users, which might well happen
here.

However on the other hand I have some doubts it's really a good
idea to expose fatal MCEs to modules. MCE is a rather critical
code path (a bit similar to an oops), with the machine
already somewhat instable in many cases and if you allow
arbitary modules to hook into that you risk long term
instability.

So if a notifier is done I would recommend to only limit
it to corrected MCEs (machine_check_poll), not fatal ones.

-Andi

--
ak@linux.intel.com -- Speaking for myself only.