Re: [PATCH v3 0/2] x86/mce: Rate-limit messages from corrected error floods

From: Borislav Petkov

Date: Fri Nov 13 2026 - 18:53:40 EST


On Fri, Nov 13, 2026 at 04:49:13AM -0800, Breno Leitao wrote:
> A machine check bank that reports corrected errors at a high rate
> makes the MCE code print two messages without any bound: "Machine
> check events logged" for every error mce_log() queues, and "CMCI storm
> detected" / "CMCI storm subsided" every time the bank enters or leaves
> storm mode.
>
> One host printed about 100 million "Machine check events logged" lines
> an hour. On another, the storm notices were 82% of everything it wrote
> to the kernel log.
>
> Patch 1, from Rik, restores the two-per-minute limit that "Machine
> check events logged" had before it moved into mce_log(). It is a fix
> and is tagged for stable.
>
> Patch 2 puts both storm notices behind one ratelimit, with the default
> interval and burst.

Yeah, maybe I wasn't too explicit in my question, sorry. I was asking more about
whether it would make sense to have a single:

static DEFINE_RATELIMIT_STATE(shut_up_too_load_mce_prints, DEFAULT_RATELIMIT_INTERVAL,
DEFAULT_RATELIMIT_BURST);

which all the mce printks can use?

I.e., a single ratelimit for all. Or even:

mce_print_ratelimit(...)

which does that.

The mce code is full of homegrown shit like per-CPU vars left and right and
other hackery which got grown for some reason back then and I don't want to
add more if not absolutely necessary.

I hope that makes more sense.

Thx.

--
Regards/Gruss,
Boris.

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