lkml.org 
[lkml]   [2019]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2019-04-16 15:56    [W:0.081 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site