linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luck, Tony" <tony.luck@intel.com>
To: Yazen Ghannam <yazen.ghannam@amd.com>,
	"Hansen, Dave" <dave.hansen@intel.com>,
	"Sironi, Filippo" <sironi@amazon.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "bp@alien8.de" <bp@alien8.de>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
Subject: RE: [PATCH] x86/mce: Increase the size of the MCE pool from 2 to 8 pages
Date: Mon, 16 Oct 2023 16:14:25 +0000	[thread overview]
Message-ID: <SJ1PR11MB60832922E4D036138FF390FAFCD7A@SJ1PR11MB6083.namprd11.prod.outlook.com> (raw)
In-Reply-To: <dc57436b-8483-4c50-a7a9-0f895a494ada@amd.com>

> > An automatic resizing one doesn't have to be fancy and only has to
> > expand once:
> >
>
> Why once?
>
> > static bool expanded = false;
> >
> > ...
> >
> >     if (full && !expanded) {
> >             expand();
> >             expanded = true;
> >     }
> >
> > It might be a _wee_ bit worse than that because you might have to queue
> > some work outside of #MC context but seriously we're talking 10-ish
> > lines of code.  It'd probably be even smaller than doing it when poked
> > by userspace and wouldn't involve new ABI.
>
> Okay, I'm with you here.

I'm not. The reason that pool exists is so that an error record (struct mce)
can be copied into it during machine check context and atomically added
to the mce_event_llist. See mce_gen_pool_add().

I don't see how your "expand()" function is going to safely allocate additional
pages to the pool while executing in the machine check handler.

Just make it one of:

1) CONFIG option
2) boot command line option.
3) Dynamic based on num_online_cpus()

-Tony



      reply	other threads:[~2023-10-16 16:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-11 16:33 [PATCH] x86/mce: Increase the size of the MCE pool from 2 to 8 pages Filippo Sironi
2023-10-11 17:32 ` Dave Hansen
2023-10-12 11:46   ` Sironi, Filippo
2023-10-12 11:52     ` Borislav Petkov
2023-10-12 15:49     ` Dave Hansen
2023-10-16 14:14       ` Yazen Ghannam
2023-10-16 14:24         ` Dave Hansen
2023-10-16 14:40           ` Borislav Petkov
2023-10-16 14:47           ` Yazen Ghannam
2023-10-16 16:14             ` Luck, Tony [this message]

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=SJ1PR11MB60832922E4D036138FF390FAFCD7A@SJ1PR11MB6083.namprd11.prod.outlook.com \
    --to=tony.luck@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=sironi@amazon.de \
    --cc=tglx@linutronix.de \
    --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;
as well as URLs for NNTP newsgroup(s).