[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d2378cc7-d97e-4e8d-b1e7-af5ce3265d2e@suse.com>
Date: Wed, 14 Jan 2026 08:17:50 +0200
From: Nikolay Borisov <nik.borisov@...e.com>
To: Borislav Petkov <bp@...en8.de>, "Luck, Tony" <tony.luck@...el.com>
Cc: "Li, Rongqing" <lirongqing@...du.com>, Thomas Gleixner <tglx@...nel.org>,
Ingo Molnar <mingo@...hat.com>, Dave Hansen <dave.hansen@...ux.intel.com>,
"x86@...nel.org" <x86@...nel.org>, "H . Peter Anvin" <hpa@...or.com>,
Yazen Ghannam <yazen.ghannam@....com>, "Zhuo, Qiuxu" <qiuxu.zhuo@...el.com>,
Avadhut Naik <avadhut.naik@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>
Subject: Re: [PATCH] x86/mce: Fix timer interval adjustment after logging a
MCE event
On 14.01.26 г. 0:41 ч., Borislav Petkov wrote:
> On Tue, Jan 13, 2026 at 10:31:58PM +0100, Borislav Petkov wrote:
>> Ufff, how silly and overengineered we've made it. I need to think about
>> a cleaner solution tomorrow...
>
> One idea I just thought of:
>
> those two steps:
>
> 1. setting mce_need_notify, and
>
> 2. testing and clearing it
>
> are basically logically a one query: do we have logged errors, or, IOW, is the
> gen pool not empty?
>
> IOW, this below.
>
> That'll get rid of that gunk of when should we test and when set and will
> JustWork(tm) for what we want it to do.
>
> But let's see how it all really works tomorrow...
>
> diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
> index 34440021e8cf..c378d4d450b6 100644
> --- a/arch/x86/kernel/cpu/mce/core.c
> +++ b/arch/x86/kernel/cpu/mce/core.c
> @@ -595,7 +595,7 @@ static bool mce_notify_irq(void)
> /* Not more than two messages every minute */
> static DEFINE_RATELIMIT_STATE(ratelimit, 60*HZ, 2);
>
> - if (test_and_clear_bit(0, &mce_need_notify)) {
> + if (!mce_gen_pool_empty()) {
> mce_work_trigger();
>
> if (__ratelimit(&ratelimit))
> @@ -618,10 +618,6 @@ static int mce_early_notifier(struct notifier_block *nb, unsigned long val,
> /* Emit the trace record: */
> trace_mce_record(err);
>
> - set_bit(0, &mce_need_notify);
> -
> - mce_notify_irq();
> -
so now mce_notify_irq() is not being called from the early notifier, i.e
the callchain mc_poll_banks -> machine_check_poll -> mce_log no longer
call mce_notify_irq() in the early notifier chain.
> return NOTIFY_DONE;
> }
>
Powered by blists - more mailing lists