mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "Zhuo, Qiuxu" <qiuxu.zhuo@intel.com>
Cc: "Luck, Tony" <tony.luck@intel.com>,
	Nikolay Borisov <nik.borisov@suse.com>,
	"Li,Rongqing(ACG CCN)" <lirongqing@baidu.com>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"H . Peter Anvin" <hpa@zytor.com>,
	Yazen Ghannam <yazen.ghannam@amd.com>,
	Avadhut Naik <avadhut.naik@amd.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
Subject: Re: [PATCH] x86/mce: Restore MCA polling interval halving
Date: Tue, 21 Apr 2026 14:05:16 +0200	[thread overview]
Message-ID: <20260421120516.GDaedn_OTOE2Agrl59@fat_crate.local> (raw)
In-Reply-To: <CY8PR11MB71343373617F535A8EC5A2C0892F2@CY8PR11MB7134.namprd11.prod.outlook.com>

Hi Qiuxu,

On Mon, Apr 20, 2026 at 02:14:52PM +0000, Zhuo, Qiuxu wrote:
> 1. Test precondition:
>      - Added debug messages [1] on top of Boris' patch.
>      - RAS_CEC was disabled.
>      - A correctable error was injected every 10 seconds.
> 
> 2. Tested with CMCI interrupts enabled:
>    - The message "Machine check events logged" was printed each time a correctable error was injected.
>    - EDAC and mcelog in the decode chain were notified as expected.
> 
>     So, this part tested OK.
> 
> 3. Tested in polling mode (boot with "mce=no_cmci"):
>    - A CPU’s timer interval was halved after calling mce_log(), or when !mce_gen_pool_empty() was true during polling [2].
>    - A CPU’s timer interval was doubled when mce_gen_pool_empty() was true during polling [2].
> 
>     This part tested OK, but please see comments below about mce_gen_pool_empty() check in mce_timer_fn().

Thanks for testing.

> mce_timer_fn()
>   machine_check_poll()
>         mce_log()
>           irq_work_queue(&mce_irq_work)
>             ...
>               mce_irq_work_cb()
>                 mce_schedule_work()
>                   schedule_work(&mce_work)
>                     ...
>                       mce_gen_pool_process() // [3] worker thread concurrently running on any CPU handles MCE logs.
> 
>   mce_gen_pool_empty() // [4]
> 
> It seems there is a race between [3] and [4].
> Although my testing did not observe this race, it's possible 
> that mce_timer_fn() (in softirq) completes fast 
> enough that it always finishes before [1] (in worker thread) is scheduled to run.

Does this and the next message in the thread explain the situation?

https://lore.kernel.org/r/20260207115142.GBaYcnTp7maUDVv3Nc@fat_crate.local

Bottom line: I don't think this was ever meant to be anything but a rough and
simple method to catch too many errors being logged and halve the polling
interval.

IOW, even if the above race happens, in the abundance of too many errors, it
would pick up and start halving eventually.

Right?

Thx.

-- 
Regards/Gruss,
    Boris.

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

  reply	other threads:[~2026-04-21 12:05 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-12  8:27 [PATCH] x86/mce: Fix timer interval adjustment after logging a MCE event lirongqing
2026-01-12  8:56 ` Nikolay Borisov
2026-01-12  9:36   ` 答复: [外部邮件] " Li,Rongqing
2026-01-12  9:51     ` Borislav Petkov
2026-01-12 10:24       ` 答复: " Li,Rongqing
2026-01-13  9:51         ` Borislav Petkov
     [not found]           ` <39cfb093256f4da78fe0bc9e814ce5d0@baidu.com>
2026-01-13 12:48             ` 答复: " Borislav Petkov
2026-01-13 18:53               ` Luck, Tony
2026-01-13 18:55                 ` Nikolay Borisov
2026-01-13 19:13                   ` Borislav Petkov
2026-01-13 19:25                     ` Nikolay Borisov
2026-01-13 19:33                       ` Borislav Petkov
2026-01-13 19:37                         ` Nikolay Borisov
2026-01-13 19:44                           ` Borislav Petkov
2026-01-13 19:51                             ` Nikolay Borisov
2026-01-13 20:33                               ` Borislav Petkov
2026-01-13 19:10                 ` Borislav Petkov
2026-01-13 19:31                 ` Nikolay Borisov
2026-01-13 20:30                 ` Thomas Gleixner
2026-01-13 20:56                 ` Borislav Petkov
2026-01-13 21:05                   ` Luck, Tony
2026-01-13 21:31                     ` Borislav Petkov
2026-01-13 22:41                       ` Borislav Petkov
2026-01-14  0:30                         ` Luck, Tony
2026-01-14 13:50                           ` Borislav Petkov
2026-01-14 14:48                             ` Borislav Petkov
2026-02-02 15:18                               ` Borislav Petkov
2026-02-02 23:49                                 ` 答复: [外部邮件] " Li,Rongqing
2026-02-06 22:03                                   ` Borislav Petkov
2026-02-07 11:51                             ` Borislav Petkov
2026-02-09 17:37                               ` Luck, Tony
2026-02-10 15:01                                 ` Borislav Petkov
2026-03-06  7:37                                   ` 答复: [外部邮件] " Li,Rongqing(ACG CCN)
2026-03-06 14:00                                     ` Borislav Petkov
2026-03-06 14:38                                       ` 答复: " Li,Rongqing(ACG CCN)
2026-03-06 15:29                                         ` Borislav Petkov
2026-03-07  1:18                                           ` 答复: " Li,Rongqing(ACG CCN)
2026-03-16 13:44                                             ` Borislav Petkov
2026-04-06 22:49                                               ` [PATCH] x86/mce: Restore MCA polling interval halving Borislav Petkov
2026-04-07 12:51                                                 ` Nikolay Borisov
2026-04-07 15:04                                                 ` Zhuo, Qiuxu
2026-04-14 21:18                                                   ` Borislav Petkov
2026-04-14 22:22                                                     ` Luck, Tony
2026-04-15 19:27                                                       ` Borislav Petkov
2026-04-15 19:53                                                         ` Luck, Tony
2026-04-15 20:02                                                           ` Borislav Petkov
2026-04-17 11:50                                                             ` Borislav Petkov
2026-04-20 14:14                                                               ` Zhuo, Qiuxu
2026-04-21 12:05                                                                 ` Borislav Petkov [this message]
2026-04-21 15:49                                                                   ` Zhuo, Qiuxu
2026-04-23 12:49                                                                     ` Borislav Petkov
2026-04-15 13:39                                                     ` Zhuo, Qiuxu
2026-04-15 19:35                                                       ` Borislav Petkov
2026-01-14  6:17                         ` [PATCH] x86/mce: Fix timer interval adjustment after logging a MCE event Nikolay Borisov
2026-01-14 13:52                           ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260421120516.GDaedn_OTOE2Agrl59@fat_crate.local \
    --to=bp@alien8.de \
    --cc=avadhut.naik@amd.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lirongqing@baidu.com \
    --cc=mingo@redhat.com \
    --cc=nik.borisov@suse.com \
    --cc=qiuxu.zhuo@intel.com \
    --cc=tglx@kernel.org \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=yazen.ghannam@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®