Re: [RFC PATCH] x86/mce: Provide sysfs interface to show CMCI storm state

From: Borislav Petkov
Date: Tue Jun 01 2021 - 16:36:11 EST


On Tue, Jun 01, 2021 at 01:05:05PM -0700, Tony Luck wrote:
> Scripts that process error logs can do better if they know whether
> Linux is executing in CMCI storm mode (only polling and reporting
> some errors instead of trying to report them all). While it is possible
> to parse the console log for:
>
> CMCI storm detected: switching to poll mode
> CMCI storm subsided: switching to interrupt mode
>
> messages, that is error prone.
>
> Add a new file to sysfs to report the current storm count.
>
> Reported-by: Christopher BeSerra <beserra@xxxxxxxxxx>
> Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
> ---
>
> RFC questions:
> 1) Is there a better way to do this?

Probably.

But I'm unclear as to what this whole use case is. The very first
"Scripts that process error logs" already sounds like a bad idea - I'd
expect userspace consumers to open the trace_mce_record() and get the
MCE records from there. And in that case CMCI storm shouldn't matter...

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette