From: Aristeu Rozanski <aris@ruivo.org>
To: Tony Luck <tony.luck@intel.com>
Cc: Borislav Petkov <bp@alien8.de>,
"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
"aris@redhat.com" <aris@redhat.com>
Subject: Re: [RFC PATCH] mce: prevent concurrent polling of MCE events
Date: Fri, 12 May 2023 13:32:51 -0400 [thread overview]
Message-ID: <20230512173251.GB4090740@cathedrallabs.org> (raw)
In-Reply-To: <ZF18kdWCWKqFc23p@agluck-desk3.sc.intel.com>
On Thu, May 11, 2023 at 04:38:57PM -0700, Tony Luck wrote:
> I just ran a test on a system booted with mce=no_cmci and saw the
> duplicate reporting. Digging into the code I see that I'm not the
> first to think that a little randomness in timers on different CPUs
> would be a good idea. The MCE code starts/restarts timers with:
>
> mod_timer(t, round_jiffies(when));
>
> Looking at the round_jiffies() function I sw that it is grabbing
> the current CPU number.
>
> unsigned long round_jiffies(unsigned long j)
> {
> return round_jiffies_common(j, raw_smp_processor_id(), false);
> }
>
> And round_jiffies_common() explains with this comment:
>
> /*
> * We don't want all cpus firing their timers at once hitting the
> * same lock or cachelines, so we skew each extra cpu with an extra
> * 3 jiffies. This 3 jiffies came originally from the mm/ code which
> * already did this.
> * The skew is done by adding 3*cpunr, then round, then subtract this
> * extra offset again.
> */
> j += cpu * 3;
>
> rem = j % HZ;
>
> So your original patch https://lore.kernel.org/all/Y8WtE7BNJ0gTrqIS@cathedrallabs.org/
> that just added the spinlock should be fine!
Thanks Tony. You want me to resend it or the original is enough?
--
Aristeu
next prev parent reply other threads:[~2023-05-12 17:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-16 20:01 [RFC PATCH] mce: prevent concurrent polling of MCE events Aristeu Rozanski
2023-01-17 17:42 ` Luck, Tony
2023-01-17 18:44 ` Aristeu Rozanski
2023-01-17 18:54 ` Luck, Tony
2023-01-17 18:58 ` Aristeu Rozanski
2023-04-28 15:51 ` Aristeu Rozanski
2023-04-28 16:43 ` Luck, Tony
2023-05-11 23:38 ` Tony Luck
2023-05-12 17:32 ` Aristeu Rozanski [this message]
2023-05-12 19:19 ` Luck, Tony
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=20230512173251.GB4090740@cathedrallabs.org \
--to=aris@ruivo.org \
--cc=aris@redhat.com \
--cc=bp@alien8.de \
--cc=linux-edac@vger.kernel.org \
--cc=tony.luck@intel.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