[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190416135508.GG31772@zn.tnic>
Date: Tue, 16 Apr 2019 15:55:09 +0200
From: Borislav Petkov <bp@...en8.de>
To: "Ghannam, Yazen" <Yazen.Ghannam@....com>
Cc: "linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"tony.luck@...el.com" <tony.luck@...el.com>,
"x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH v2 4/6] x86/MCE: Make number of MCA banks per_cpu
On Thu, Apr 11, 2019 at 08:18:03PM +0000, Ghannam, Yazen wrote:
> @@ -1478,15 +1480,16 @@ EXPORT_SYMBOL_GPL(mce_notify_irq);
>
> static int __mcheck_cpu_mce_banks_init(void)
> {
> + u8 n_banks = this_cpu_read(mce_num_banks);
> int i;
>
> per_cpu(mce_banks, smp_processor_id()) =
> - kcalloc(MAX_NR_BANKS, sizeof(struct mce_bank), GFP_KERNEL);
> + kcalloc(n_banks, sizeof(struct mce_bank), GFP_KERNEL);
>
> if (!this_cpu_read(mce_banks))
> return -ENOMEM;
>
> - for (i = 0; i < MAX_NR_BANKS; i++) {
> + for (i = 0; i < n_banks; i++) {
> struct mce_bank *b = &this_cpu_read(mce_banks)[i];
>
> b->ctl = -1ULL;
> @@ -1507,10 +1510,15 @@ static int __mcheck_cpu_cap_init(void)
> rdmsrl(MSR_IA32_MCG_CAP, cap);
>
> b = cap & MCG_BANKCNT_MASK;
> - if (WARN_ON_ONCE(b > MAX_NR_BANKS))
> + pr_debug("CPU%d supports %d MCE banks\n", smp_processor_id(), b);
What for?
You're removing the "Using" message because, yeah, it was worthless to
people. If anyone wants to count the banks:
$ ls /sys/devices/system/machinecheck/machinecheck0/bank* | wc -l
23
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
Powered by blists - more mailing lists